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.
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.