UNPKG

lib-colors

Version:

Simple node.js library for work with colors

14 lines (13 loc) 323 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.grayToRgb = grayToRgb; function grayToRgb(gray) { const { g, a } = { ...gray }; const grayscale = Math.round((g / 100) * 256) - 1; return { r: grayscale, g: grayscale, b: grayscale, a, }; }