Skip to content

Fix paletteLerp() returning undefined outside p5.strands - #9347

Open
LalitNarayanYadav wants to merge 2 commits into
processing:mainfrom
LalitNarayanYadav:fix/palettelerp-cpu-fallback
Open

LalitNarayanYadav wants to merge 2 commits into
processing:mainfrom
LalitNarayanYadav:fix/palettelerp-cpu-fallback

Conversation

@LalitNarayanYadav

Copy link
Copy Markdown
Contributor

Resolves #9328

Changes:

  • paletteLerp() returned undefined outside p5.strands because the strands override returned early without calling the original CPU implementation. The override now saves the original paletteLerp and delegates to it when no strands context is active, the same pattern lerpColor uses.
  • Adds a regression test that calls paletteLerp() outside strands and checks the interpolated color. It fails without the fix (undefined) and passes with it.
  • Strands behavior and the argTypes metadata are unchanged, and the existing paletteLerp and argTypes tests still pass.

This regression came from #8817. Targeting the 2.4 milestone.

PR Checklist

  • npm run lint passes
  • Unit tests are included / updated

@LalitNarayanYadav
LalitNarayanYadav marked this pull request as ready for review October 28, 2026 03:48
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]: paletteLerp() returns undefined outside p5.strands

1 participant