News for hackers. Stuff that matters.
Re:The 12-bit rainbow palette by otikik on Tuesday April 29, 2025 @05:27AM (#43830342)
> L is for lightness (0-100%), C is for chroma (0-0.5), H is for hue (0-360deg).

My programmer brain immediately jumped away in disgust.

I'm sure there's many good reasons for choosing those, but it seems to me it could have easily have been done with 3 percentages (0-100% for the 3 numbers). Way easier to work with programmatically.

Re:The 12-bit rainbow palette by dimava on Tuesday April 29, 2025 @06:57AM (#43830902)
Hue is a cyclic value, so it has to be in degrees

Chroma cap is dependent on Lightness and Hue, so it has to be unsized to preserve "equal delta leads to equal color distinction" concept

In color spaces you just don't have any math that can be done without following its structure

You may check https://oklch.com/ on how the color space looks like

Re:The 12-bit rainbow palette by otikik on Tuesday April 29, 2025 @10:30AM (#43833204)
> Hue is a cyclic value, so it has to be in degrees

There's nothing magical about the number 360. You can do cycles in the 0-1 range. You can even make trigonometry with that (no radians). See:

http://pico8wiki.com/index.php?title=Sin