Repository navigation
Use one color picker for all colors - #14
Open
RrrrobertB1992 wants to merge 13 commits into
Open
RrrrobertB1992 wants to merge 13 commits into
RrrrobertB1992 wants to merge 13 commits into
Conversation
A row of color buttons above the picker picks which color it edits. Only the colors in use are shown, followed by a single "+" that adds the next color. Colors 2 and up get a Remove button; removing a color moves the later ones down. This replaces scrolling through a full picker per color and the checkbox(es) for turning extra colors on. The original color fields stay in the page with only the selected one shown, so reading, writing and file handling are unchanged. Works with the single "Additional Colors" checkbox (colors 2-4 move up next to Color 1) and with a checkbox per color. Formats with one color keep the plain Color 1 picker. Made with help from Claude
Their inline display style was overriding the rule that hides them. Made with help from Claude
Made with help from Claude
With two or more colors, any color can be removed, including Color 1; the later colors move down one. With a single color there's no Remove button. Made with help from Claude
- Color buttons and + work from the keyboard (Tab, Enter/Space), like the other palettes, and keep focus after a press. - A new color starts as a copy of the previous one instead of white. - "◀ Move left" / "Move right ▶" swap the selected color with its neighbour. - Removing a color asks to confirm first. Made with help from Claude
Remove now comes first in the row, and Move left/right are always shown (greyed out when they can't be used), so repeated taps on a Move button never land on a different button. Made with help from Claude
- Every color shows the same one-line hint ("Hold and drag on the
picker, or type a hex code"), so the picker no longer moves up and
down when switching between Color 1 and the others.
- Hex boxes keep only hex digits, switch to upper case, stop at 6
characters and drop a pasted leading #. The cursor stays where it was
when a character is rejected.
Made with help from Claude
- A 3-digit hex code (e.g. F53) expands to 6 digits (FF5533) when the box is left, when switching, adding or moving colors, and right before writing, downloading or saving. - Any other length (1, 2, 4, 5 digits, or empty) is not a valid color: the box turns red with a message under it, and its color button gets a red outline. Writing, downloading and "Save current colors" are stopped with a status message, and the picker jumps to the first bad color. The error clears as soon as the code is valid. Made with help from Claude
Leaving a hex box updates the page, which redrew the color buttons in the middle of the tap that left it, so the first tap on + or another color could be lost. The buttons are now only redrawn when the number of colors or the selected color changes. Made with help from Claude
While a hex code isn't valid, its preview box and color button show a red-striped pattern instead of a color (the browser would show e.g. "C039" as a see-through color, and the button showed white). A 3-digit code is shown as its expanded color. A bad color's button keeps its red outline even when selected. Made with help from Claude
Made with help from Claude
The box's 7-character limit cut pastes like "##FF5733" short before
they could be cleaned, leaving 5 digits. Pasting now picks the first
stand-alone 3, 6 or 8 digit hex code out of the pasted text ("##FF5733",
"0xFF5733", " #ff5733cc ", "Color: #FF5733") and puts it in the box,
replacing what was there; alpha is dropped. Clipboard text inserted by
a keyboard without a paste event is handled the same way. The box has
no browser length limit any more; typing still stops at 6 digits.
Made with help from Claude
A 3-digit code no longer shows the "not a valid color" error while it's still in the box (it's expanded on leaving, or before writing/saving), and a pasted 3-digit code like "#abc" is expanded to AABBCC right away. Made with help from Claude
This branch has not been deployed
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.
Replaces the full picker per color (and the checkboxes for turning extra colors on) with one shared picker and a row of color buttons, so multi-color filament no longer means scrolling past a picker for every color.
What it does
##FF5733,0xFF5733,#ff5733cc,Color: #FF5733) and replaces the box; alpha is dropped and 3 digits are expanded.F53) is accepted and expands toFF5533when the box is left, when switching/adding/moving colors, and before writing, downloading or saving.All the code is in a new
public/colorslots.js, loaded afterapp.js;app.jsisn't changed.Testing
Tested on a Samsung Galaxy S26 (Chrome, Android) with real tags, together with #7 and #13:
#drops the#.#abcgivesAABBCCright away; typingF53shows no error while still in the box; 1, 2, 4, 5 digits or an empty box show the error after leaving it.#s in front (e.g.##FF5733) gives the right code.Everything above, plus keyboard use (not tested on the phone), is also covered by automated Playwright tests (headless Chromium, mocked Web NFC) on both color layouts.
Made with help from Claude