UNPKG

@atlaskit/adf-schema

Version:

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

11 lines 396 B
import { expandShorthandHex } from './expand-shorthand-hex'; import { FULL_HEX_REGEX } from './lch-color-inversion'; export var rgbFromHex = function rgbFromHex(input) { var fullHex = expandShorthandHex(input); var result = FULL_HEX_REGEX.exec(fullHex); return result === null ? null : { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) }; };