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.
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.
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.
When the Color Guide's base is a spot color, or a tint of one, picked in
the Swatches panel, with the Color panel's tint slider or with the base
chip, the cells right of the center in the base row of Tints/Shades are
now tints of that spot color. A click paints the art with the tint, a
drag carries it, and Save Colors as Swatches and Save Color Group to
Swatches make tint swatches linked to the spot color, so they follow an
edit of it. Shades, other rows, Warm/Cool, Vivid/Muted and a Limit to
Library give process colors, as before.
A cell's tint is the base's tint reduced by the share the cell goes
toward white. The guide follows a rename of the spot color swatch.
`swatch.new {colors}` and `swatch.newGroup {colors}` take
`{swatch, tint}` entries: a tint below 100% of a global or spot color
becomes a tint swatch ("Name 40%") linked to it.
A gradient swatch saved as CSS wrote only its own stops, so CSS put an
off-center midpoint at the center and mixed a Perceptual or hue gradient
in a straight line between its stops. CSS mixes hex colors evenly in sRGB
between two stops (https://www.w3.org/TR/css-color-4/#interpolation-space),
so the export now writes the midpoints and the curve as stops of their
own, each with its color and opacity, also on repeated, reflected and
mirrored conic swatches. A gradient that would need more than
MAX_SPREAD_STOPS stops that way is written with its own stops.
Part of #978. The Color Wheel panel menu gains HSL Sliders, shown in
place of OKLCH Sliders: H (0 to 360°), S and L (0 to 100 %) rows under
the wheel or the box that edit the hue, saturation and lightness of the
color's display sRGB, as CSS Color 4 defines HSL
(https://www.w3.org/TR/css-color-4/#the-hsl-notation). A pick goes into
the working RGB space as the wheel's picks do, the rows keep the hue of
a gray, and they take the arrow keys and report their names, values and
ranges to screen readers as the OKLCH rows do.
- vectorcraft-color: rgb_to_hsl and hsl_to_rgb follow the conversions
in CSS Color 4 sections 7.1 and 7.2, with Color::to_hsl and
Color::from_hsl beside to_hsb and from_hsb.
- ui.colorWheel takes sliders: "hsl"; an unknown value now answers
"`sliders` must be none, oklch or hsl".
- Docs: docs/mcp.md, docs/control-protocol.md and the Color Wheel
evidence in docs/target-app-parity.md.
- CMYK colors converted between two loaded CMYK profiles now use the
Color Settings black point compensation, as RGB colors already did:
the conversion goes through linear ProPhoto RGB and maps the source
profile's black onto the destination's.
- The edit.colorSettings, document.open and file.newFromTemplate params
text and docs/mcp.md name file.newFromTemplate with the commands that
apply the policies, and say that colorMode on open converts after the
policies, through the profiles the document keeps.
- A test covers New from Template under the policies, and another the
CMYK black point compensation.
- Convert to Working Space between CMYK spaces with no direct transform
goes through the Lab the source displays (black-point compensated),
so dark inks keep their appearance instead of being compensated twice.
- An open that waits on the Profile Mismatch dialog keeps the automation
roots it was asked under: OK reads linked files and installs the
document under them.
- A paste that runs at once remembers the document it was asked in. When
another document is active by the time OK is pressed, it pastes nothing.
edit.colorSettings takes askMismatchOpen, askMismatchPaste and
askMissingOpen (off by default), kept in Color Settings.json and shown in
the Separations panel's Color Settings section. With a box on, File > Open
asks before a document opens whose color mode's profile is not the working
space (use the embedded profile, convert the colors, discard the profile) or
that has none (leave it, assign the working space, assign a profile), and
Paste asks whether colors copied from a document with another profile keep
their numbers or convert. Each prompt starts on what the policy does; Cancel
opens or pastes nothing.
document.open takes the answer as profileChoice (with assignProfile) and
never asks. The paste commands take profileMismatch, and without it follow
the policy of each model, as a drag between documents does.
clipboard.profileMismatch lists the models a paste would ask about.
With Output > Convert to Destination and an sRGB destination, a gray or
RGB image that carries an ICC profile (a Display P3 TIFF, a PNG or JPEG
with an embedded profile) is converted from that profile to sRGB with
the color settings' rendering intent and written without the profile.
Before, it kept its own numbers and profile.
- A 16-bit image that is not resampled or recompressed stays at 16 bits
a sample from PDF 1.5 on.
- A JPEG kept as JPEG whose samples the conversion leaves unchanged (an
sRGB profile) keeps its JPEG data; other JPEGs are encoded again.
- A black-and-white image whose converted levels are gray is compressed
as grayscale.
- A profile the color engine can't read is kept, with a warning.
- Without conversion, and with Preserve Numbers, images keep their
profile as before.
IccProfile::to_srgb_pixels converts a run of pixels in one pass.
Docs: docs/mcp.md, document.exportPdf params, target-app-parity.
edit.colorSettings takes rgbPolicy (off, preserveEmbedded, convert) and
cmykPolicy (the same and preserveNumbers), kept in Color Settings.json.
document.open, File > New from Template and File > Revert apply the policy
of each model to a profile the file is tagged with that is not the working
space: Preserve Embedded Profiles keeps it, Off and Preserve Numbers take it
off and keep the numbers, and Convert to Working Space converts that model's
colors into the working space and takes it off. The replies list a warning
per profile, and a changed document opens with unsaved changes. The
Separations panel's Color Settings section has the two lists.
A colorMode asked for on open converts after the policy, through the
document's own profiles. Document Color Mode also converts the points of
freeform gradient swatches.
View › Proof Setup › Customize… opened the Separations Preview panel.
It now opens a Proof Setup dialog: Device to Simulate (the working CMYK
space or any CMYK or RGB profile), Preserve CMYK Numbers or Preserve RGB
Numbers, Rendering intent (off while the numbers are preserved),
Simulate Paper Color, Simulate Black Ink and Preview. OK sets the proof
setup and turns Proof Colors on; Cancel puts the earlier proof back.
view.proofSetup takes an "rgb:<profile>" target, preserveNumbers and
simulateBlack, and its reply carries both. Simulate Black Ink shows the
device's black without black-point compensation. With Preserve Numbers
the renderer proofs each color from its own numbers as it paints it,
placed CMYK images from their own inks, and the inks a CMYK document
blends; the paper under the art takes Simulate Paper Color's tint.
The Color Wheel panel's menu gets OKLCH Sliders: L, C and H rows under the
wheel or the box that edit the color by the OKLCH lightness (0 to 100 %),
chroma (0 to 100 % of 0.4) and hue of its display sRGB, as CSS Color 4
defines them. Each track dims the colors outside sRGB, and a tick on the C
track marks the largest chroma that fits; a color outside sRGB keeps L and H
and takes that chroma. The rows are gray, and the menu item and
ui.colorWheel {sliders: "oklch"} are refused, while the working RGB space is
not sRGB. The choice is kept with the preferences.
- vectorcraft-color: oklab.rs with OKLCH conversions and max_chroma.
- color.convert {to: "oklch"} answers [L %, C, H°].
- ui.colorWheel takes sliders next to view and channel.
Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md.
The Color Wheel panel menu has Show Harmony and Harmony Rule. With Show
Harmony on, the wheel's ring carries a marker for each other color of
the picked rule, filled with that color, and the markers follow the
current color. A click on a marker, or Enter or Space on a focused one,
applies its color as a pick on the wheel does; Alt applies it to the
inactive Fill/Stroke proxy. Screen readers read each marker as
"Harmony color" with its hex value.
The wheel takes the 15 Color Guide rules whose colors each have a hue
of their own. Harmony::apply_hsb gives a rule's colors as HSB, and a
gray base keeps its hue so the markers stay apart on the ring.
ui.colorWheel takes harmony and harmonyRule, and both are kept with the
preferences. Docs: docs/mcp.md, docs/target-app-parity.md.
A gradient's Separation or DeviceN space, and EPS's %%DocumentCustomColors,
named the spot ink of every linked stop. A stop out of order whose
neighboring stretches have no width, a stop at a tint of 0 without process
plates, and in PDF a stop whose stretches are fully transparent print no
ink, but their spot inks were still declared, so separations got an empty
plate.
- vectorcraft-color: Gradient::drawn_stops (the rule Document Info uses,
moved here) and Gradient::reached_stops (every stop taken as opaque).
- PDF: Separation and DeviceN shadings, the Perceptual spot shadings and
the spot-image warning name only inks of drawn stops at a tint above 0
or with process plates; other stops are written with no ink, so their
process inks and RGB or Lab colors no longer shape the space either.
- EPS: the same with reached stops, since EPS writes stops opaque; a
transparent spot stop keeps its ink.
Output is unchanged when every stop colors part of the gradient and every
spot stop has a tint above 0 or process plates.
With Window › Arrange › Tile or floating document windows, every document
other than the front one was drawn through the profiles the front document
is assigned, since the active color settings are process-wide.
- cms::with_active puts other settings in place of the active ones on one
thread, fast paths included, and puts them back after (also on a panic).
cms::for_document gives the context a document's assigned profiles make,
the same one each time for the same profiles and working settings.
- Each pane renders its document's art through colormgmt::doc_cms, on the
render worker and on the UI thread alike, and draws its paper, artboard
colors and transparency grid through the same settings.
- Loading or removing a profile redraws the documents assigned it, the
ones behind the front one included.
- The ink and separation tables keep the tables of up to four color
settings, so documents with different CMYK profiles side by side do not
rebuild them on each redraw.
Placed documents inside a document behind the front one still draw through
the front document's profiles.
A gradient stop that loses its link to a spot swatch kept the process
plates it printed with that ink, so it carried a DeviceN mix with no
ink. Paint::map_links, which deleting a swatch, recoloring and color
adjustments go through, now clears a stop's plates whenever it leaves
the stop without a link, as GradientStop::set_color(color, None)
already does. Library gradients and library character styles linked
to a swatch the document lacks unlink their stops the same way.
Docs: docs/target-app-parity.md.