Re:Show HN: Penumbra, a perceptually optimized color palette...
by solasluaith on Friday August 05, 2022 @08:28AM
(#32355130)
The saturation (or to be more accurate in this case, chroma) is actually already as high as possible (unless I’ve made a fundamental mistake) given the constraint that we want it to be uniform across colours and also uniform luminance. sRGB simply doesn’t allow for more sadly and I’m afraid it will probably be a long time before a new standard colour space for consumer displays comes around that would improve this.
This tool that others have linked is pretty good if you’re fine with relaxing the constraints (just make sure to change to colour space to LCH OKlab): https://huetone.ardov.me.
Re:Show HN: Penumbra, a perceptually optimized color palette...
by yarg on Friday August 05, 2022 @02:35AM
(#32352530)
//fix the sine wave amplitude and offset
static final float CHANNEL_MUL = 127.5f;
static final float OFFSET_R = 0f;
static final float OFFSET_G = (float)(TWO_PI/3);
static final float OFFSET_B = 2 * OFFSET_G;
public int buildColour(float theta){
final int r = round(CHANNEL_MUL * (1f + sin(theta + OFFSET_R)));
final int g = round(CHANNEL_MUL * (1f + sin(theta + OFFSET_G)));
final int b = round(CHANNEL_MUL * (1f + sin(theta + OFFSET_B)));
return 0xFF000000 | (r << 0x10) | (g << 0x08) | b;
}
I was messing around with something similar (before I found out about Oklab), that generated a nice pastel colour ring.
(I didn't (at the time) know how to get the colours to a fixed perceptual saturation level, so gave up intending to come back to it.)
(If I were doing it now, I'd use Oklab for normalisation.)[0] - https://bottosson.github.io/posts/oklab/