UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

17 lines (16 loc) 566 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.rgbFromHex = void 0; var _expandShorthandHex = require("./expand-shorthand-hex"); var _lchColorInversion = require("./lch-color-inversion"); var rgbFromHex = exports.rgbFromHex = function rgbFromHex(input) { var fullHex = (0, _expandShorthandHex.expandShorthandHex)(input); var result = _lchColorInversion.FULL_HEX_REGEX.exec(fullHex); return result === null ? null : { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) }; };