Skip to content

Include use of relevant maxes in hue(), saturation(), brightness() and lightness()#8062

Merged
ksen0 merged 2 commits into
processing:dev-2.0from
limzykenneth:fix-hsbl-maxes
Sep 16, 2025
Merged

Include use of relevant maxes in hue(), saturation(), brightness() and lightness()#8062
ksen0 merged 2 commits into
processing:dev-2.0from
limzykenneth:fix-hsbl-maxes

Conversation

@limzykenneth
Copy link
Copy Markdown
Member

Resolves #7998

Changes:

The utility functions didn't take into account the current maxes of the relevant color modes, this implements it. One particular caveat is that hue() applies to HSB, HSL but also LCH and OKLCH which also have hue values. This may or may not be desired but for consistency sake they are included.

PR Checklist

Comment thread src/color/creating_reading.js Outdated
// p5._validateParameters('saturation', arguments);
return this.color(c)._getSaturation();
const colorMode = (
this._renderer.states.colorMode === HSB ||
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor/optional: isn't this the same as (this._renderer.states.colorMode === HSB) ? HSB : HSL? that seems a little more readable.

@ksen0 ksen0 merged commit 10a2d43 into processing:dev-2.0 Sep 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants