Palette calibration: precise hex/RGB inputs instead of a color picker
Build and push server image / build-and-push (push) Successful in 41s
Build and push server image / build-and-push (push) Successful in 41s
A native <input type="color"> swatch can't be typed into precisely -- no way to enter an exact measured value. Replaced with a small table: a read-only preview swatch, a hex text field, and three 0-255 number fields (R/G/B) per ink color, kept in sync live in both directions (editing hex updates R/G/B and the swatch; editing any of R/G/B updates hex and the swatch). Hex stays the field actually read at save time -- the server-side validation (#rrggbb via hex_to_rgb) is unchanged, this is a client-side-only swap of the input widget.
This commit is contained in:
+25
-20
@@ -168,28 +168,33 @@ summary.card-title { cursor: pointer; margin-bottom: 0; }
|
||||
details.card[open] summary.card-title { margin-bottom: 14px; }
|
||||
details.card .sub { margin-top: 8px; }
|
||||
|
||||
.palette-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 14px;
|
||||
.palette-table-wrap { overflow-x: auto; margin-top: 14px; }
|
||||
.palette-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
||||
.palette-table th {
|
||||
text-align: left;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
font-size: 11.5px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.02em;
|
||||
padding: 0 8px 8px 0;
|
||||
}
|
||||
.palette-swatch {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--text);
|
||||
.palette-table td { padding: 4px 8px 4px 0; vertical-align: middle; }
|
||||
.palette-table input { margin-top: 0; }
|
||||
.palette-swatch-preview {
|
||||
display: block;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.palette-swatch input[type="color"] {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
padding: 2px;
|
||||
margin-top: 0;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
.palette-table input.palette-hex {
|
||||
width: 92px;
|
||||
font-family: ui-monospace, "SF Mono", Consolas, monospace;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
.palette-table input.palette-rgb {
|
||||
width: 58px;
|
||||
}
|
||||
|
||||
.card {
|
||||
|
||||
Reference in New Issue
Block a user