You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Haven't tried other colorModes but I'm pretty sure this is a bug. Seems that if I pass 1000 the max for all HSB values, passing 1000 for the hue breaks things while passing 1000 for saturation/brightness gets me the max as I expect.
// Assume 1000 is the maximum allowed value (that is, inclusive) passed in to color() as docs suggest
colorMode(HSB, 1000, 1000, 1000, 1000);
color(0, 0, 0); // RGB is 0, 0, 0 as expected
color(0, 1000, 1000); // RGB is 255, 0, 0 as expected
color(999, 1000, 1000); // RGB is 255, 0, 1.53; ok
color(1000, 1000, 1000); // RGB is 255, 0, 255. Huh???
// So is 999 the true max allowed value?
color(0, 999, 999); // RGB is 254.745, 0.2547, 0.2547 so that's not right
You’re right, this is a bug. HSB colours with hue at max value are being rendered as magenta, regardless of the user-defined maximum. HSL seems to be fine.
Activity
ecridge commentedon Jun 11, 2016
You’re right, this is a bug. HSB colours with hue at max value are being rendered as magenta, regardless of the user-defined maximum. HSL seems to be fine.
I’ll take a look into it.
Add regression tests for processing#1459
Rearrange if statement in _hsbaToRGBA, fixes processing#1459
ecridge commentedon Jun 11, 2016
The
ifstatement inp5.ColorConversion._hsbaToRGBAdidn’t take into account the fact thatsectorcould be 6. Should be fixed now. 😅hobzcalvin commentedon Jun 11, 2016
Great; thanks for the quick response!
Merge pull request #1460 from joecridge/hsb-with-max-hue
lmccart commentedon Jun 15, 2016
thanks both for identifying and fixing!