2d-color-picker: code editor support and other improvements - #9161
Open
mxmou wants to merge 9 commits into
Open
Conversation
* Handle no longer moves slightly on drag start * Handle is now always fully inside the slider * The center of the handle is now precisely on the correct shade
mxmou
commented
Aug 11, 2026
Member
Author
There was a problem hiding this comment.
This SVG file is intentionally not minified - it contains a comment explaining how I calculated the offsets for gradient stops.
| "name": "2D color picker", | ||
| "description": "Replaces saturation and brightness sliders in the costume editor with a 2D color picker. Hold Shift while dragging the cursor to change the values on a single axis.", | ||
| "description": "Replaces saturation and brightness sliders with a 2D color picker. Hold Shift while dragging the cursor to change the values on a single axis.", | ||
| "tags": ["editor", "costumeEditor"], |
Member
Author
There was a problem hiding this comment.
I wasn't sure if I should add the codeEditor tag. The hex color picker addon doesn't have it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2017
Resolves #7253
Changes
Code editor
The addon now works in the code editor. I moved UI code to a new ShadePicker class which is shared between the code editor and costume editor versions.
UI improvements
And this PR:
This was also done for consistency with Scratch's sliders. The background gradient has been updated so that the center of the handle is still on the correct shade.
Other improvements
Tests
Tested on Edge (Windows) and mobile Firefox (Android).