"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = opacity;

var _isHexColor = _interopRequireDefault(require("./isHexColor"));

function opacity(hex, opacity) {
  if (!(0, _isHexColor.default)(hex)) return null;
  return hex + Math.floor(opacity / 100 * 255).toString(16);
}

module.exports = exports.default;