Commit Graph
195 Commits
Author SHA1 Message Date
BFlat 06390d163b Merge pull request #7632 from dotCooCoo/feat/color-wheel-oklch-sliders-v2
Color Wheel: OKLCH Sliders give exact black and white, describe the document's RGB space and drop a remembered pick after an undo step
2026-11-27 05:18:50 +07:00
BFlat 478432c8b0 Merge pull request #8346 from dotCooCoo/feat/fogra51-52-cmyk-v2
Color: FOGRA51 and FOGRA52 CMYK working spaces computed from Fogra's data
2026-11-27 00:53:58 +07:00
dotCooCoo d9b119a371 Color Wheel: a channel just below sRGB counts as outside it
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.
2026-11-26 00:18:32 -08:00
dotCooCoo 0d5d6d34f3 Merge main into feat/color-wheel-oklch-sliders-v2 2026-11-25 19:27:00 -08:00
FredApps ae70a8f174 Resolve main documentation conflict in History row menu PR #8845 2026-11-26 03:27:16 +01:00
dotCooCoo 1d6f0340e2 Merge main into feat/color-wheel-contrast
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.
2026-11-25 16:36:08 -08:00
ruchirguitar c766f2f450 History panel: add snapshot-safe row context menus and keyboard access 2026-11-26 04:54:14 +05:30
dotCooCoo 5ca10060b3 Merge main into feat/color-wheel-oklch-sliders-v2 2026-11-25 13:58:13 -08:00
dotCooCoo c27619310a Merge main into feat/fogra51-52-cmyk-v2 2026-11-25 10:19:57 -08:00
BFlat 6f37bd839c VectorCraft on the craft UI framework (#8800)
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.
2026-11-24 08:25:24 +07:00
dotCooCoo a7ab3b782e Merge main into feat/fogra51-52-cmyk-v2 2026-11-20 05:42:42 -08:00
dotCooCoo 4aa133a285 Merge main into feat/color-wheel-contrast 2026-11-19 16:36:02 -08:00
dotCooCoo 0cb9626d42 Merge main into feat/color-wheel-oklch-sliders-v2 2026-11-19 16:20:20 -08:00
dotCooCoo 00322ad70f Color Wheel: OKLCH lightness endpoints give exact black and white
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.
2026-11-19 11:27:47 -08:00
dotCooCoo 5d489b511a Merge main into feat/color-wheel-contrast 2026-11-19 11:17:08 -08:00
Codex 75813b3be8 fix: preserve palette color conversion and localization keys 2026-11-19 13:53:34 -05:00
Dylan M. Taylor 7d44f644e8 color: use shared craft-cms palette codecs with localized errors 2026-11-19 13:52:36 -05:00
bflatastic eee6f40a92 Merge remote-tracking branch 'origin/main' into fix/8044 2026-11-19 23:39:16 +07:00
dotCooCoo d056974654 Merge main into feat/color-wheel-contrast 2026-11-19 06:46:07 -08:00
BFlat 16756500bf Merge pull request #8700 from dotCooCoo/fix/print-perceptual-paper-plateau
Print: a Perceptual gradient keeps the ink below across a paper-white stretch
2026-11-19 21:33:06 +07:00
dotCooCoo 88cac70e8b Color Wheel: find the largest OKLCH chroma on every stretch of the ray
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.
2026-11-19 06:23:20 -08:00
dotCooCoo 1c841c481e Merge main into feat/color-wheel-contrast 2026-11-19 05:22:26 -08:00
dotCooCoo dafade6173 Merge main into feat/proof-setup-customize
# Conflicts:
#	crates/ui-egui/src/dialogs.rs
#	crates/ui-egui/src/i18n/tests.rs
2026-11-19 05:04:12 -08:00
dotCooCoo 50b039cd10 Merge main into feat/color-wheel-hsl-sliders 2026-11-19 05:03:21 -08:00
dotCooCoo 63c48ce676 Merge main into feat/fogra51-52-cmyk-v2 2026-11-19 04:54:11 -08:00
dotCooCoo ce009c54a8 Print: a Perceptual gradient keeps the ink below across a paper-white stretch
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.
2026-11-19 04:48:33 -08:00
BFlat df42e09ba5 Merge pull request #7733 from dotCooCoo/feat/color-profile-ask-prompts
Color Settings: Ask When Opening and Ask When Pasting prompt about profile mismatches
2026-11-19 14:52:30 +07:00
dotCooCoo 5fe226850d Color Wheel: keep the OKLCH chroma search below the asked chroma
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.
2026-11-18 16:21:28 -08:00
dotCooCoo 95ed13dd80 Color Settings: answer the review of the profile prompts
- 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.
2026-11-18 15:42:03 -08:00
dotCooCoo 1d7f3f6f22 Color Wheel: fix OKLCH and HSL slider review findings
- 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.
2026-11-18 15:37:33 -08:00
dotCooCoo ada4f67f33 Proof Setup: a loaded CMYK profile's black follows black-point compensation
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.
2026-11-18 14:23:29 -08:00
dotCooCoo 119d8c0264 Color: keep the paper for absolute colorimetric Generic CMYK conversions
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.
2026-11-18 13:59:04 -08:00
dotCooCoo d3cd060e12 Color: refuse truncated Fogra data and a dark paper; hold out repeated builds together
- 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.
2026-11-18 08:24:43 -08:00
dotCooCoo 30658a24f4 Merge main into feat/fogra51-52-cmyk-v2 2026-11-18 07:31:08 -08:00
dotCooCoo 3903d948d4 Proof Setup: a CMYK device that is not loaded leaves colors as they are
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.
2026-11-18 06:53:27 -08:00
dotCooCoo 877fd21dca Merge main into feat/color-profile-ask-prompts 2026-11-18 06:03:13 -08:00
dotCooCoo 98e38b4bdd Merge main into feat/proof-setup-customize 2026-11-18 01:42:37 -08:00
dotCooCoo 9e902a313c Merge main into feat/color-wheel-hsl-sliders 2026-11-18 01:42:29 -08:00
dotCooCoo 3e381d1de5 Merge main into feat/color-wheel-contrast 2026-11-17 22:21:46 -08:00
dotCooCoo b838b9036e Merge main into feat/color-wheel-harmony 2026-11-17 22:16:53 -08:00
dotCooCoo 0b1ba1c6ef Merge main into feat/proof-setup-customize 2026-11-17 20:24:50 -08:00
dotCooCoo 8e9004d89d Merge main into feat/color-wheel-contrast 2026-11-17 20:24:29 -08:00
dotCooCoo 8eb976164b Merge main into feat/color-wheel-hsl-sliders 2026-11-17 20:24:27 -08:00
dotCooCoo 816e83c90e Merge main into feat/color-wheel-harmony 2026-11-17 19:38:37 -08:00
dotCooCoo ced9eefa1f Color: test that built-in CMYK profiles separate saturated inks back
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.
2026-11-17 18:21:31 -08:00
dotCooCoo f473f825eb Merge main into feat/color-profile-ask-prompts 2026-11-17 12:38:20 -08:00
dotCooCoo eaf50e01ef Tests: name the FOGRA ink-order test after the limit it checks
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.
2026-11-17 10:43:11 -08:00
dotCooCoo b314df82cf Color: FOGRA51 and FOGRA52 CMYK working spaces computed from Fogra's data
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
2026-11-17 08:36:11 -08:00
dotCooCoo 102cfd0cde Color: built-in CMYK profiles carry their paper and an exact colorimetric table
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.
2026-11-17 08:30:52 -08:00
dotCooCoo dea8ab9b68 Merge main into feat/color-guide-spot-tints 2026-11-16 19:47:49 -08:00