hsluv-ts
hsluv-ts is a TypeScript wrapper around the hsluv
color library, which lacks type definitions.
Install
// If you use yarnyarn add hsluv-ts // If you use npmnpm install hsluv-ts
Usage
The type definition file should illustrate the usage of the various conversion functions.
declare ;/** * hue is a number between 0 and 360, saturation and lightness are numbers between 0 and 100. This function returns the resulting color as a hex string. */declare ;/** * Like above, but returns an array of 3 numbers between 0 and 1, for the r, g, and b channel. */declare ;/** * Takes a hex string and returns the HSLuv color as array that contains the hue(0 - 360), saturation(0 - 100) and lightness(0 - 100) channel.Note: The result can have rounding errors.For example saturation can be 100.00000000000007 */declare ;/** * Like above, but red, green and blue are passed as numbers between 0 and 1. */declare ;/** * hue is a number between 0 and 360, saturation and lightness are numbers between 0 and 100. This function returns the resulting color as a hex string. */declare ;/** * Like above, but returns an array of 3 numbers between 0 and 1, for the r, g, and b channel. */declare ;/** * Takes a hex string and returns the HSLuv color as array that contains the hue(0 - 360), saturation(0 - 100) and lightness(0 - 100) channel.Note: The result can have rounding errors.For example saturation can be 100.00000000000007 */declare ;/** * Like above, but red, green and blue are passed as numbers between 0 and 1. */declare ;declare ;declare ;declare ;declare ;declare ;declare ;declare ;declare ;declare ;declare ;declare ;declare ;