tints.dev
tints.dev copied to clipboard
Clamp lightness values to prevent out of range hex codes and null values
Fixes #82
In the UI there is value for a user in being able to set lightness/luminance maximum and minimum values beyond the boundaries permitted by the standard. It allows a palette range to be widened so the ends are not near white/black.
The end values used in the calculations however need to be clamped in order to prevent hex codes beyond 255.
In an earlier PR the hue and saturation were clamped. This PR simply applies that to lightness/luminance as well. Additionally adding a safety clamp at the HSLtoRGB helper level.
Awesome project! Found this to be much more useful than many of the other tailwind palette generators out there. cheers!