The gamut test allowed 1e-4 beyond 0..1, so OKLCH colors such as L 0.01, C 0.01,
H 0 were clipped at their own chroma and not reported as lowered, and the C track
marked the wrong maximum. The allowance is now 1e-5, above the 1.7e-6 matrix
round-trip error of sRGB boundary colors.
The contrast row, its menu rows and its tests move to the craft UI framework,
as main's Color Wheel panel now uses it:
- The row is a Row with a Swatch named Background (a color well whose value is
the background's hex value) and Text for the ratio and the AA and AAA
results, each with the WCAG minimums as its tooltip.
- Show Contrast, Contrast For and Contrast Background are rows of the panel
menu's items (ui.colorWheel.contrast, contrastFor.<id>,
contrastBackground.below and contrastBackground.current), after Show
Opacity. Current Color is gray, and its row answers an error, while the
active proxy has no solid color.
- The kept background and ratio answer are fields of WheelUi instead of panel
state. The answer's key also holds whether the Live Paint Bucket paints,
which changes the proxies' paint without a document revision.
- The row's tests run in the panel's Fixture by accessible name; the drag test
runs an interaction whose previews set the fill, as the Show Document Colors
drag test does.
- The settings lists in the params text, docs/mcp.md and the tests take both
opacity and the contrast keys.
VectorCraft's UI moves onto the shared craft UI framework in storytold/craft-libs (`next`; the framework side is storytold/craft-libs#2809), as PhotoCraft's did. The app keeps its engine, document model, file formats, commands and automation; its windows, panels, bars, dialogs and canvas are now built and driven by the framework: shell, docking and panels, hosted dialogs, keyboard, focus, IME and pointer routing, and theme tokens.
About 264,000 lines of VectorCraft's own egui UI code are removed and about 154,000 added. craft-libs is pinned at bf62d509f (in `next`), the egui fork at f5025284.
Tests that drove the old UI were rewritten against the port where only their premise changed, with their assertions kept. The UI tests still failing at merge, and their follow-ups, are listed in the pull request.
from_oklch returns exactly black at lightness 0 and exactly white at
lightness 1, as CSS Color 4 specifies, and reports a positive chroma
there as lowered. The gamut tolerance no longer leaves a positive red
channel at L=0.
The command text and docs say a color outside sRGB takes the largest
chroma that fits at or below the one asked for, that color.convert
measures the stored color's display sRGB, and that a null key keeps its
value. The saved-settings test also checks that an unknown slider value
keeps the saved view.
The chromas sRGB holds along a ray of fixed lightness and hue can come
in several stretches, and the search looked past the first one only
near a primary color's hue. Near black the gamut slack opens stretches
at other hues: at L 0.02 and H 242 degrees the ray fits up to about
0.022 but the search stopped near 0.012, so the chroma tick sat too low
and a pick past the gamut lost more chroma than it had to.
Each linear sRGB channel is a cubic in the chroma, so the search now
takes the chromas where a channel meets a gamut bound, between each
cubic's turning points, and keeps the largest one that fits. A test
compares the result with a scan of the ray at 720 lightness and hue
pairs.
Follow-up to #8400. A Perceptual gradient expands each segment into
stops on its OKLab curve. Between two stops of the same color the round
trip through OKLab rounded the color, so a stretch between two
paper-white stops came out as nearly white RGB. On a PostScript plate
the separator then saw ink there, and an overprinting gradient painted
over the ink below across that stretch.
Gradient::expanded now gives a stop between two stops of the same color
that color, unchanged, for every method. GradientMethod::mix and
Gradient::sample are not changed.
The first chroma search in largest_fitting_chroma ran from 0 to 0.5 and
could land on the line from black to blue above the chroma asked for. The
result then fell back to the asked chroma, which lies outside sRGB, and
from_oklch clipped it, changing the lightness and hue. The search now
stops at the asked chroma, so the chroma it finds always fits.
The parity doc now says color.convert's OKLCH matches the rows only for
a color inside sRGB, since it clips the display RGB first.
- An absolute-colorimetric conversion from CMYK starts from the source's
absolute appearance.
- An assigned profile that was removed counts as the working space when
copied colors are compared.
- Colors that can't convert are listed with convertible false, start on
Preserve Numbers, and the dialog disables Convert for them.
- Paste on All Artboards leaves the backgrounds of copied artboards out of
the question (clipboard.profileMismatch allArtboards).
- A converting paste into its own document keeps its image keys.
- An open answer is refused once Color Settings change the question; the
dialog asks the new question, or opens by the policy.
- Files opened while a question is open ask their own questions in turn.
- OK on the paste question and on Swatch Conflict checks again where the
paste runs and asks again when the question changed.
- docs/mcp.md and the command help describe these rules.
- The largest chroma at a hue near a primary color finds the stretch past
the first gamut edge, so pure blue at chroma 0.4 stays blue. The C track
dims the gap between the two stretches.
- Oklab conversions use the signed sRGB transfer curve for channels below 0.
- HSL hues wrap before the channel offsets; Color::to_hsl and from_hsl are
removed, so callers pass the color settings themselves.
- color.convert {to: "oklch"} clips RGB numbers past 0 to 1, as hex does.
- A hue on a gray, or a saturation on black or white, leaves a Gray paint
unchanged and records no undo step.
- Remembered row and wheel components are dropped once the panel shows
another color or target.
- Hiding or switching the rows during a row drag keeps the preview as one
undo step and ends the interaction.
- The L and H tracks keep their colors until the other two components
change, so a frame does not search the gamut for every track color.
- Docs name the document's assigned profile as the RGB space OKLCH Sliders
need, and give color.convert's example its color.
A loaded ICC CMYK profile as the device to simulate showed its darkest
ink without the color settings' black-point compensation, so Simulate
Black Ink made no difference there. It now shows it as the working CMYK
proof of the same profile does, and Simulate Black Ink shows the press
black as gray.
Cancel and turning Preview off now put back the proof view the dialog
found even when its device profile was removed since, and redraw the
documents. Running Proof Setup again while the dialog is open keeps
the open dialog, so Cancel still restores the first view.
The Preserve CMYK Numbers tests put the working color settings back
when they end, a failing run included, and the mask test checks the
proofed square's coverage against the unmasked K100 square and the
page.
Convert to Working Space now passes the absolute Lab of a Generic-type
source (Generic CMYK, FOGRA51, FOGRA52) to the destination for the
absolute colorimetric intent, so the source paper tint carries into the
converted inks. CMYK to RGB in those spaces shows the paper with the
absolute intent instead of relative white. The PDF/X test also checks
the output condition identifier written for Generic CMYK.
- measured::parse needs END_DATA and checks a NUMBER_OF_SETS in the
header against the rows it read.
- measured::fit refuses a paper whose XYZ is not positive and finite.
- The left-out test keeps every row of a repeated build on the side of
its first row; the docs line gives the new figures.
- The round trip of a 50% gray is asserted whatever the gamut check says.
- The output intent doc comment and the docs line say when the FOGRA
identifier and color.org registry defaults apply.
With Preserve CMYK Numbers on and a CMYK device whose profile is not
loaded, proof_color separated an RGB color into the working CMYK space
and showed the inks back through it, so a saturated blue changed while
the same color as a pixel stayed as it is. It now returns the color's
display color, as the RGB devices do.
The colorimetric table of each built-in CMYK profile is checked on
solid and two-color overprint inks: CMYK to the connection space and
back through the profile's own tables lands within a Delta E 2000 of 3
of the original inks.
more_ink_never_lightens_a_build allows an L* rise of up to 0.3 (the
largest is 0.193 for FOGRA51 and 0.234 for FOGRA52). The test is now
more_ink_lightens_a_build_by_less_than_0_3_l, and its comment states the
limit.
Two new built-in CMYK working spaces, VectorCraft Coated CMYK (FOGRA51)
and VectorCraft Uncoated CMYK (FOGRA52), follow Generic CMYK in every
profile list. Generic CMYK stays the default.
Fogra publishes the measured colors of these printing conditions and
allows the data to be redistributed unmodified with Fogra named as the
source. The two files ship byte for byte in crates/color/data/, with a
test that pins their SHA-256. The press model is computed from them the
first time a space is used: the paper, solids and overprints are the
measured patches, each ink's tone curve is fitted to its ramp, and a
smoothed Lab correction lattice is fitted to all 1,617 patches. The
300% ink limit and the black generation are VectorCraft's own values.
A PDF/X output intent made with one of them names FOGRA51 or FOGRA52
in the http://www.color.org registry and embeds the profile, unless the
settings give an identifier or registry. The profile's copyright tag
names Fogra as the data source.
Part of #3790
The ICC profile written for a built-in CMYK working space (embedded in
PDF, TIFF, JPEG and PSD exports) changes in two ways:
- The media white point (wtpt) is the model's paper instead of D50, so
the ICC-absolute colorimetric intent reproduces the paper.
- The colorimetric Lab -> CMYK table (B2A1), which the gamut tag is also
sampled from, is the inverse of the CMYK -> Lab table without
black-point compensation. Before, all three Lab -> CMYK tables had
compensation built in, so a dark build such as C40 M30 Y30 K60 that
went through the profile and back missed by Delta E 2000 2.7 on
Generic CMYK. The perceptual and saturation tables keep compensation.