FLUJOS/VISUALIZACION/node_modules/polished/lib/internalHelpers/_hslToHex.js.flow
2025-11-07 00:06:12 +01:00

18 lines
545 B
Text
Executable file

// @flow
import hslToRgb from './_hslToRgb'
import reduceHexValue from './_reduceHexValue'
import toHex from './_numberToHex'
function colorToHex(color: number): string {
return toHex(Math.round(color * 255))
}
function convertToHex(red: number, green: number, blue: number): string {
return reduceHexValue(`#${colorToHex(red)}${colorToHex(green)}${colorToHex(blue)}`)
}
function hslToHex(hue: number, saturation: number, lightness: number): string {
return hslToRgb(hue, saturation, lightness, convertToHex)
}
export default hslToHex