Cannot get JUCE to produce the exact specified colors!

I have an older app I’m porting. I want to use some of the same exact colors.

This is one of the colors, as shown in the Photoshop color picker.

Adobe Photoshop 2021ScreenSnapz005

As you can see, it can be specified as any of these:

RGB 51, 255, 153

HSV 150*, 80% 100%

# 33ff99

I have tried to create this color in JUCE. I have tried three different ways:

const Colour hilightGreen  { 0xff33ff99 };   // HSB 150 80 100

const Colour hilightGreen = Colour::fromHSV (150.0f/360.0f, .8f, 1.0f, 1.0f);

const Colour hilightGreen = Colour::fromRGB (51, 255, 153);

And yet, the resulting color when sampled in Photoshop is always wrong, being:

HSV 145, 67, 100

This picture shows the JUCE version with the green squares on the grid sampled. The values are not exactly correct:

This picture shows the original app, sampling the center of the green squares, side by side with the JUCE app in the same screen shot. Correct values:

This is by taking a screenshot with the MacOs X Mojave screen shot utility (Command-3) and looking at the colors in Photoshop.

Now, before someone says my “color space” or color settings must be wrong in Photoshop, I launched the old app right next to my JUCE project and took the screen shot of both of them, at the same time - the color is correct in the old app, while it is this slightly skewed value in the JUCE app.

1 Like

See: Incorrect image colour rendering in Pro Tools - #17 by railjonrogut

So it seems you are saying this is a Mac OS issue - but why does my old app display the correct colors, while the JUCE app side-by-side with it displays skewed values for the “same” color?

The JUCE app tells the OS to color correct it, the old app does not and thus gets “incorrect” colors.

You could calibrate your monitor and create a custom color profile, which might get you closer, but it would still look different for everyone else

Why is it so important to you to match the output exactly?

The color 0xff33ff99 (RGB 51, 255, 153) may look slightly different on different monitors and to different people - but when you sample it on the screen (with something like Photoshop that is living inside the same colorspace) it should still be RGB 51, 255, 153 regardless of what your color profile is. The values don’t change; just the perception of what color they are, right?

I mean, if I tell my audio processing algorithm to use the number 1.5 and instead it uses the number 1.344389 - then it’s a problem. I’m just trying to understand why I tell it specifically to create a certain color on the screen and it DOESN’T.