Commit Graph
642 Commits
Author SHA1 Message Date
dotCooCoo d5a8da3dc4 Merge main into feat/color-wheel-opacity 2026-11-16 08:26:15 -08:00
dotCooCoo f178cebd3c Merge main into feat/color-wheel-document-colors 2026-11-16 08:25:34 -08:00
dotCooCoo 40654ded92 Merge main into feat/color-wheel-box 2026-11-16 08:25:33 -08:00
dotCooCoo b9f7ba955c Merge main into feat/color-wheel-vision-preview 2026-11-16 08:25:24 -08:00
dotCooCoo 34476ef1bc Merge main into feat/color-wheel-hex-alpha-css 2026-11-16 08:20:19 -08:00
dotCooCoo be27667228 EPS Options: Custom… sets the flattener options the export uses
EPS Options gets a Custom… button beside the flattener Preset. It opens
Custom Transparency Flattener Options over EPS Options, on the options the
export would use (the raster/vector balance, both resolutions, the outline
switches, Clip Complex Regions and Anti-alias Rasters). OK sends them as
`flattener` with the export, and the preset shows [Custom] when they
differ from its options; Cancel goes back unchanged. Choosing a preset,
in the dropdown or with `ui.dialog.set`, drops the custom options.
Preserve Alpha Transparency stays off for EPS, and overprints follow the
Overprints choice.
2026-11-16 07:16:50 -08:00
dotCooCoo bf8c08e2a1 Recolor Artwork: the Edit tab's wheel can show brightness and hue
A button under the Add Color and Remove Color tools switches both Edit
tab wheels between hue with saturation and hue with brightness. On the
brightness wheel a marker's distance from the center is its brightness
(black at the center, full at the edge), a drag sets hue and brightness,
the slider under the wheel edits saturation, and Add Color adds the hue
and brightness clicked at the base color's saturation. The segmented
wheel's five rings become brightness steps. Switching changes no color,
the button is off for the color bars, and each opening shows hue and
saturation. The dialog field is `wheelAxes` (`hueSaturation`,
`hueBrightness`).
2026-11-16 04:50:45 -08:00
dotCooCoo ec57fd6625 Merge main into fix/status-notes-copy-cut-trace 2026-11-16 04:06:45 -08:00
dotCooCoo ac75f6ddc5 Merge main into feat/color-wheel-opacity 2026-11-16 02:50:39 -08:00
dotCooCoo b7bef0a308 Color Wheel: the hex field keeps an opacity press, and color.parse takes only CSS whitespace
- A text committed when a press on the opacity slider takes the focus
  is applied to the target read again, so it keeps the opacity the press
  set, and the field compares the text with what it showed before the
  press, so the text is not dropped.
- color.parse takes only spaces, tabs and line breaks around the text and
  its arguments (https://www.w3.org/TR/css-syntax-3/#whitespace); a
  no-break or ideographic space makes the text an error.
- The texts name the hsl() refusal for saturation and lightness so large
  that a channel overflows, and say the field shows the alpha when the
  opacity rounds to less than ff.
- color.parse's params text keeps the forms of the text inside
  parentheses, so every_description_parses reads it as one key.
- A test types a color with only a type object selected: the characters
  take the color and no fill item is added for the alpha.
2026-11-16 02:05:11 -08:00
dotCooCoo 47d6facb74 Part of #978: Show Hex Field in the Color Wheel panel takes hex with an alpha and CSS colors
Panel menu › Show Hex Field (ui.colorWheel {hexField}) adds a field under
the wheel or the box. It shows the color's six hex digits, and two more
while the opacity that Show Opacity sets is under 100 %. It takes a hex
color of 3, 4, 6 or 8 digits and a CSS rgb(), hsl() or oklch() color. A
typed color is applied in the same way as a wheel pick, in one undo step,
and an alpha sets that opacity, whether or not the opacity row shows.
Where the opacity row is gray (nothing selected, an object selected in a
symbol instance, or a fill or stroke row on type characters or missing),
only the color is applied. Text that gives the color and opacity already
there records no undo step, unless the color is a tint of a global
swatch. A click on the wheel that takes the focus from an edited field
applies the text, then the click. An opacity edit of a gradient stop or
point keeps the OKLCH values picked last for it, as it keeps the HSB.

- crates/color/src/css.rs reads the hex, rgb(), rgba(), hsl(), hsla()
  and oklch() syntax of CSS Color 4, the comma-separated legacy form of
  rgb() and hsl() included, and clamps values where CSS clamps them when
  it parses them. VectorCraft's own rules on top of that: the # of a hex
  color may be left out, none reads as 0, an hsl() channel outside the
  sRGB range is clipped, an oklch() color outside sRGB takes the largest
  chroma that fits, and text over 48 characters is refused.
- color.parse {text} answers {color, hex, opacity}; oklch() is an error
  while the working RGB space is not sRGB.
- The Color panel's hex field and the color parameters of other commands
  still refuse #rrggbbaa and #rgba.

Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md.
2026-11-16 00:44:14 -08:00
dotCooCoo c643f9f5e1 Text Import Options: Character Set offers the other documented encodings
The Character Set menu of Text Import Options now lists Shift JIS, GB2312,
Chinese Big 5, Cyrillic, GB18030, Greek, Turkish, Baltic and Central European
beside Unicode and ANSI, and `file.place {text: {characterSet}}` takes
"shiftJis", "gb2312", "chineseBig5", "cyrillic", "gb18030", "greek",
"turkish", "baltic" and "centralEuropean". Each set decodes with its WHATWG
Encoding Standard decoder from encoding_rs, which the workspace already
locks: GB2312 reads as GBK, Cyrillic as windows-1251 (x-mac-cyrillic with
platform "mac"), and Greek, Turkish, Baltic and Central European as
windows-1253, 1254, 1257 and 1250 on both platforms. A byte-order mark is
read as ordinary bytes and a malformed sequence as U+FFFD. Unicode and ANSI
read as before.

An unknown character set is an error that lists the sets, and nothing is
placed. A `text` option of the wrong type (`characterSet: 3`,
`removeLineReturns: "yes"`) is now an error instead of the default. The
dialog remembers the last set confirmed, and Show Import Options off places
with it.
2026-11-16 00:16:03 -08:00
dotCooCoo 43cb6f0c0c Merge main into fix/tool-set-option-errors 2026-11-15 23:28:59 -08:00
dotCooCoo cc5d3b5537 Color Wheel: the box and the wheel mark the contrast lines and offer the closest passing color
With Show Contrast on, the wheel's square and the box's field draw where
the color picked there meets AA (solid) and AAA (dashed) for the chosen
category, each as a white line over a black one. The field is sampled on
a 33 by 33 grid and each crossing is placed by bisection, so a line can
run across the field or up it; a passing band narrower than the samples
is found by looking for the highest ratio around a failing sample higher
than its neighbors.

When the color fails AA, or meets AA and fails AAA, a chip at the end of
the contrast row shows the closest color that passes that level, and a
click applies it. The chip keeps its space while hidden, so the row does
not move as a drag crosses a line. Screen readers read it as a button.

color.contrast takes `for` (normalText, largeText or graphics) and
answers `for` and `fix: {aa, aaa}` (no aaa for graphics): for each level,
the closest color that meets it when drawn the same way (blend modes,
opacity, translucent groups and layers, the stain of a picked symbol
object), in the model of the measured color, or null when the color
already meets it or no lightness of its hue does. The search keeps the
OKLCH hue, raises or lowers the lightness, whichever takes the smaller
step, lowers the chroma where sRGB cannot show it, and tests at most 167
colors.

Part of #978
2026-11-15 23:20:49 -08:00
dotCooCoo 388044db13 Color: Sample Color from Screen works on Windows
Windows had no screen color sampler, so the Color Picker's eyedropper
button was gray and ui.sampleScreenColor returned an error there.

The new sampler copies the virtual screen (every monitor, including
ones at negative coordinates and at other display scales) and covers it
with a borderless topmost window that shows the copy under a crosshair.
A left click picks the copied pixel, read as sRGB. Escape, a click of
another mouse button, Alt+F4 or switching to another window cancels.
The window runs on its own thread, so the app keeps drawing, and the
copy's size is checked before it is allocated.

Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md
and the ui.sampleScreenColor params text.
2026-11-15 23:15:43 -08:00
dotCooCoo 982c99da88 Merge main into feat/recolor-group-storage
# Conflicts:
#	crates/engine/src/cmd/swatch.rs
#	crates/ui-egui/src/dialogs/recolor.rs
#	docs/control-protocol.md
#	docs/mcp.md
2026-11-15 22:24:37 -08:00
dotCooCoo f5e9840333 Color Wheel: HSL Sliders edit a color by hue, saturation and lightness
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.
2026-11-15 22:12:47 -08:00
dotCooCoo 62a78362cd Merge feat/color-wheel-oklch-sliders-v2 into feat/color-wheel-hex-alpha-css 2026-11-15 21:30:36 -08:00
dotCooCoo 8b9ef3813d Merge main into feat/color-wheel-contrast-lines 2026-11-15 21:16:18 -08:00
dotCooCoo 144aec7dfc Merge main into fix/tool-set-option-errors 2026-11-15 20:22:03 -08:00
dotCooCoo b8c03fbe45 Merge main into feat/recolor-edit-base-color-menus 2026-11-15 19:41:18 -08:00
dotCooCoo d7b0bc0e4d Merge main into feat/recolor-group-storage 2026-11-15 18:42:52 -08:00
dotCooCoo 4c13ca2a74 Merge main into feat/color-wheel-opacity 2026-11-15 18:40:40 -08:00
dotCooCoo 3a2d2eda33 Merge main into feat/recolor-add-remove-color-tools 2026-11-15 18:36:18 -08:00
dotCooCoo 3336c00194 Merge main into feat/recolor-edit-base-color-menus 2026-11-15 16:07:44 -08:00
dotCooCoo 034f9ce9bc Merge main into feat/recolor-add-remove-color-tools 2026-11-15 16:06:06 -08:00
dotCooCoo 501567a704 Merge main into fix/tool-set-option-errors 2026-11-15 13:58:40 -08:00
dotCooCoo a075bfbffd Recolor Artwork: an excluded row keeps its color group swatch
OK on a color group sent an excluded row's new color in groupColors, so
the group's swatch at that place changed (or was removed after Remove
Color) while the row's art kept its colors. The dialog now sends "keep"
for an excluded row with current colors. recolor.apply takes "keep" in
groupColors: the swatch at that place stays as it is, without Global
Adjust, Limit to Library or the document's model, and past the group's
last swatch it adds none.
2026-11-15 13:58:25 -08:00
dotCooCoo 729651e470 Merge main into feat/psd-preserve-text-editability 2026-11-15 13:45:05 -08:00
dotCooCoo 4327c51f57 PSD: Preserve Text Editability writes point type as editable type layers
The PSD Options dialog gets Preserve Text Editability, and document.export
takes preserveText (with layers). Horizontal and vertical point type is
written as a type layer (a TySh block with its EngineData) that a reader
can edit, and keeps its pixels. The layer holds the text, its fonts by
PostScript name, size, leading, tracking, scaling, baseline shift, caps,
underline, strikethrough, fill color, Fractional Widths, paragraph
alignment and orientation.

Type that a type layer would draw differently stays pixels: area type,
type on a path, strokes, non-solid fills, fractional tracking, character
attributes the layer does not carry, paragraphs that set more than their
alignment or run right to left, System Layout, Optical Margin Alignment,
ruby, effects, an appearance of its own and opacity masks. A layer that
holds type becomes a group of its type layers and pixel layers of the art
between them, unless other art in it blends in a mode other than Normal.
2026-11-15 12:07:06 -08:00
dotCooCoo 20413c6c3d Recolor Artwork: new text uses American spelling and a neutral link label 2026-11-15 11:32:12 -08:00
dotCooCoo a1aa6ddc01 Recolor Artwork: an added color whose row is excluded joins no color group 2026-11-15 11:31:36 -08:00
dotCooCoo 2e082dcb22 Merge main into feat/recolor-group-storage 2026-11-15 11:07:12 -08:00
dotCooCoo 6fd1b1dcb1 Merge main into feat/recolor-group-storage 2026-11-15 11:06:13 -08:00
dotCooCoo 19364e923c Merge main into feat/color-wheel-opacity 2026-11-15 11:01:39 -08:00
dotCooCoo 71bceccdfd Merge main into feat/recolor-edit-base-color-menus 2026-11-15 10:53:54 -08:00
dotCooCoo 78e56b6d7a Recolor Artwork: an added color whose row is excluded joins no color group 2026-11-15 09:16:17 -08:00
dotCooCoo fdeb3a6ab3 Merge main into fix/tool-set-option-errors
# Conflicts:
#	crates/ui-egui/src/toolbar.rs
2026-11-15 09:11:04 -08:00
dotCooCoo be4dab1e8c Merge main into feat/recolor-add-remove-color-tools 2026-11-15 09:08:28 -08:00
dotCooCoo c0550a00a7 Recolor Artwork: Edit tab right-click menus set the base color, pick a shade and add colors
A right-click on a wheel marker or a color bar offers Set As Base Color,
Select Shade (a 7 by 7 grid of the color's hue), Color Picker and Remove
Color. A right-click elsewhere on the wheel offers Add New Color, and a
color added on a marker's line moves with that marker while the colors
are unlinked. Set Current Color As Base Color makes the selected color
the base.

The base color is stored on its row (`base: true`) instead of being the
first selected row, so the harmony rules build from it whichever color
is selected for the sliders. Merge, Separate, Randomize and Prominent
Colors keep the marks, and the rows sent to `recolor.apply` leave them
out.
2026-11-15 09:07:57 -08:00
dotCooCoo f1f4d629e8 Panels: the double triangle on a panel's tab strip cycles its display sizes
A double triangle at the right end of the tab strip of Align, Attributes,
Character, Color, Flattener Preview, Gradient, Info, Paragraph, Stroke,
Transform and Transparency steps the active panel through its display
sizes. The sizes are the states the panel menu's Show/Hide Options items
set (Transparency: thumbnails and options, thumbnails alone, neither),
largest first, and the smallest goes back to the largest.

window.panel.cycleOptions {panel} does the same and returns
{panel, size, sizes}. An unknown panel or a panel without sizes is an
error and changes nothing.

Docs: docs/mcp.md, docs/control-protocol.md, docs/ui-parity.md.
2026-11-15 08:39:43 -08:00
dotCooCoo 7c842131cd Merge main into feat/color-wheel-contrast 2026-11-15 07:56:35 -08:00
dotCooCoo 6635cd7748 Recolor Artwork: a Color Groups list selects, saves, adds and deletes color groups
The dialog lists the document's color groups on its right, or under
the tabs in a narrow window, and the Show Color Groups button beside
the tabs shows or hides the list. A click on a group makes it the
group being edited: with art, the art is reduced again to a row per
color of the group, which become the rows' new colors; without art,
the rows are the group's colors. Save Changes rewrites the selected
group with the colors OK would give it and the name in the name
field, New Color Group saves the rows' new colors as a new group, and
Delete removes the selected group. Each is its own undo step, and the
Swatches panel shows it.

When the art has colors of the group, Save Changes keeps the group's
swatches in order: a swatch whose color a row lists takes that row's
new color, and the others keep theirs. After a save with art the rows'
new colors take the Global Adjust, which goes back to 0%, and when the
save recolored linked art the rows are read from the art again.

The dialog fields are group, groupStorage and groupAction (save, new
or delete). A name no group has, a groupAction of another value, and
save or delete with no group selected are refused.

swatch.editGroup given a group's own colors in order and no new name
records no undo step.
2026-11-15 07:43:03 -08:00
dotCooCoo a6b73c467d Merge main into feat/recolor-add-remove-color-tools
Main's New Row and this branch's Add Color tool both make rows with no
current colors. A row made with New Row gives a rewritten color group no
color, and a color the Add Color tool adds joins the group. Rows the Add
Color tool adds now carry `added: true`: recolor.apply's default
groupColors and the dialog's apply_params add only those empty rows'
colors to the group, after the others, and recolor.randomize keeps the
flag.
2026-11-15 07:32:35 -08:00
dotCooCoo adeadaa1c5 Merge main into feat/color-wheel-contrast 2026-11-15 06:11:50 -08:00
Mex 6b821c7c50 docs(G6): complete the control method reference
Document the existing resize defaults and parameterless focus method. Keep one complete ui.render row, including traceViews, and record the documentation revision.

Source and rendered table reviewed. No local Rust build or tests ran; cargo/rustc are unavailable and PR CI validation is required.
2026-11-15 14:37:37 +01:00
dotCooCoo 42fab2ea2a Recolor Artwork: the Edit tab's Add Color and Remove Color tools add and remove colors
Two buttons under the display buttons beside the Edit tab's wheel turn on
the Add Color and Remove Color tools. With Add Color, a click on either
wheel adds a color in a new row with no current colors, at the base
color's brightness. With Remove Color, a click on a marker removes that
color; a color bar's right-click menu has Remove Color too. The base
color can't be removed. With art or a color group open, a removed
color's row keeps its current colors with no new color, so the art keeps
its colors and the group's swatch at that place is removed.

recolor.apply's groupColors accepts null, which removes the group's
swatch at that place; the swatches after it keep their colors and names,
and art linked to a removed global swatch keeps its color, unlinked.
2026-11-14 22:12:58 -08:00
dotCooCoo 79b88a22f5 Merge main into feat/color-wheel-opacity 2026-11-14 21:41:28 -08:00
dotCooCoo 397adce4c8 Merge main into feat/eraser-tip-variations 2026-11-14 18:55:44 -08:00
BFlat 3e68e4117a Merge pull request #7712 from dotCooCoo/feat/rough-pastels-load-texture
Effects: Rough Pastels loads its texture from an image file
2026-11-15 09:47:09 +07:00