A utility module created to easily convert color values to different formats.
Planned support for RGB, HEX, HSL, HSB, with or without alpha channel values.
- RGB
- Hex
- HSL
- HSB
- RGBA
- Hex w/ alpha channel
- HSLA
- HSBA
Import the Color
object to your project
and create a new instance of Color
import Color from '.../index.ts';
const myColor = new Color();
Assign it a value using any supported color format
myColor.setRGB(255,100,50);
myColor.setHex("")
...
- Need more tests, it seems like converting RGB to HEX doesn't work as expected, has problems with double 0's
- Min-max values
- Values for hsl-saturation and hsb-saturation should be stored separately
- Lacks conversion from HSL to RGB
- Lacks conversion from HSB to RGB
- Lacks conversion from HSL/RGB or HEX to HSB
- Utility function for rgbToHsb
- Utility function for hexToHsl and hexToHsb
- Utility function for hslToRgb, hslToHex and hslToHsb
- Utility function for hsbToRgb, hsbToHex and hsbToHsl
- Hsl and Hsb-String getters should use % for S-L/B values
- Add alphaPrecent getter