-
Notifications
You must be signed in to change notification settings - Fork 11
Fix/bipolar center color #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/bipolar center color #75
Conversation
| : Array(4).fill(undefined); | ||
|
|
||
| const value = param ? paramState[param] : 0; | ||
| const isBipolar = param?.endsWith("Panning"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we detect this dynamically instead of hardcoding to panning params? I think we can use paramRange from params.ts
| }; | ||
|
|
||
| const green: [number, number, number] = [170, 255, 170]; | ||
| const orange: [number, number, number] = [255, 200, 0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need orange as a specified colour, we can just rely on the blending between green and red. (I can see how that was confusing in the issue description, sorry about that!)
|
@hemanth5055 thanks for this PR! I had a few small comments. I also have a question about the video. It seems like the velocity knob also changes background colour? |
Hey @lilyvanoekel, thanks for the review .Yes, I noticed that the velocity knob background changes. I will investigate the cause and work on the issues you mentioned above. |
|
Hey @lilyvanoekel, I’ve updated the code according to your review and also fixed the issue where the velocity knob’s background was changing when adjusting the panning knob. Screen.Recording.2025-10-01.at.10.46.59.PM.mov |
📌 Description
This PR fixes the knob background color logic for parameters with ranges that span negative to positive values (e.g.,
-100 to 100).Previously, the knob background worked only for
0 → 100ranges (green → red).For bipolar ranges like
-100 → 100, the midpoint (0) should represent balance and display as green, while extremes (-100and100) should display as red.Added a gradient mapping for negative, zero, and positive values:
-100 → red-75 → orange0 → green+75 → orange+100 → red✅ Related Issue
Closes #60
📷 Screenshots
Before
Knob background incorrectly mapped
0 → greenand100 → red, but did not account for-100 → 100ranges.After
Knob background now correctly displays red at extremes, green at center, orange in between for bipolar ranges.
Screen.Recording.2025-10-01.at.5.48.09.PM.mov
🔍 Testing Done
0 → 100ranges (unchanged).-100 → 100ranges (now correct).ℹ️ Additional Notes