Skip to content

fix: lerp colors in current color mode#8920

Open
pupuking723 wants to merge 1 commit into
processing:mainfrom
pupuking723:fix/lerpcolor-current-mode
Open

fix: lerp colors in current color mode#8920
pupuking723 wants to merge 1 commit into
processing:mainfrom
pupuking723:fix/lerpcolor-current-mode

Conversation

@pupuking723

Copy link
Copy Markdown

Resolves #8883

Changes:

  • Makes Color.lerp() interpolate in the explicit mode passed by lerpColor(), instead of interpolating in the source colors' original color space and only formatting the result in the current mode.
  • Keeps the existing fallback behavior when no mode is passed.
  • Updates the existing HSL/HSB lerpColor() expectations to match current-mode interpolation. I did not add a new regression test, following the maintainer request in [p5.js 2.0+ Bug Report]: lerpColor() not affected by colorMode() #8883 to start with just the fix.

Screenshots of the change:
Not applicable.

PR Checklist

  • npm run lint passes
  • [Inline reference] is included / updated
  • [Unit tests] are included / updated

Verification:

  • npm test -- --run test/unit/color/creating_reading.js test/unit/color/p5.Color.js
  • npm run lint

AI assistance disclosure: I used Codex assistively while preparing this change. I reviewed the issue discussion, source changes, test updates, and verification output myself, and I take responsibility for the PR.

@p5-bot

p5-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

Continuous Release

CDN link

Published Packages

Commit hash: 10cf56d

Previous deployments

This is an automated message.

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.

[p5.js 2.0+ Bug Report]: lerpColor() not affected by colorMode()

1 participant