UNPKG

@kcuf/mere-color

Version:

Mere color utils for generating, manipulation, a11y purposes.

15 lines (14 loc) 393 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = toStringRgb; var _util = require("../util"); var _parse = require("../parse"); /** * Convert color string to normalized rgb string `rgb(r g b)`, `rgb(r g b / a%)`. */ function toStringRgb(input) { var rgb = (0, _parse.parseToRgb)(input); return rgb ? (0, _util.rgbToString)(rgb) : input; }