mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-29 20:27:05 -06:00
Color: freeform gradients keep CMYK inks when expanded, meshed or edited
Object > Expand and Object > Create Gradient Mesh mixed a freeform gradient's points in display RGB and turned the result back into the points' model with the profile-free formula. CMYK inks changed: points of C50 M20 Y0 K10 gave mesh points of C45 M24 Y0 K22. RGB points were stored as display sRGB, so with a working RGB space other than sRGB the mesh showed other colors. Points colored along CMYK stops, a point paint.freeform.splitLine added between CMYK points and a point paint.freeform.addPoint added without a color came out as RGB. Points that share a color model now mix in it: the C, M, Y and K values mix as inks, and Gray, RGB and Lab components mix as they are. Points in different models still mix in display RGB. Object > Expand and Object > Create Gradient Mesh store the result in the working RGB space, and in a CMYK document they store it as CMYK through the color settings, as paint.setFill stores an RGB color. Freeform::recolor and split_line mix with the new Color::lerp_keep_model, which vectorcraft_doc::blend::lerp_color now calls. Docs: docs/mcp.md, docs/target-app-parity.md.
This commit is contained in:
+9
-3
@@ -743,7 +743,10 @@ Freeform gradients: `paint.editGradient {kind: "freeform"}` places four or more
|
||||
object (coloured along the stops; `mode: "points"|"lines"` is the Draw toggle). `paint.freeform.get` lists the points
|
||||
(document coordinates), lines and the selected point; `paint.freeform.addPoint {at, color?, opacity?, spread?,
|
||||
line?}`, `setPoint {index?, …}`, `deletePoint {index?}`, `addLine {points}`, `splitLine {line, segment, t?}` and
|
||||
`selectPoint {index|null}` edit them (`index` defaults to the selected point; each edit is one undo step). With the
|
||||
`selectPoint {index|null}` edit them (`index` defaults to the selected point; each edit is one undo step). The color
|
||||
of a point colored along the stops, of a point `splitLine` adds and of a point `addPoint` adds without `color` is a mix
|
||||
of the colors around it (the two stops, the line's two points, or all the points) in the color model those colors
|
||||
share, so CMYK stops and points give CMYK points. With the
|
||||
Gradient tool on a freeform gradient a click on a point selects it (drag to move it), a click on a line adds a point
|
||||
on it, a click elsewhere on the art adds a point (in Lines mode joined to the selected one), and Delete removes the
|
||||
selected point:
|
||||
@@ -1821,7 +1824,10 @@ outlines strokes into filled paths; `fill` (on) expands gradient fills: with `gr
|
||||
no seams show; concentric ellipses for a radial one, largest first; just the bands when stops are translucent), with
|
||||
`gradient: "mesh"` into a gradient mesh that paints the gradient (columns or rings where its colour changes, sharp at
|
||||
coincident stops), each inside a clip group shaped like the object. A freeform gradient becomes a mesh shaped like the
|
||||
object either way. Expanded colours keep the colour model their stops share. `fill` also expands pattern fills: each
|
||||
object either way. Expanded colours keep the colour model their stops share. Expand mixes a freeform gradient's point
|
||||
colors in the model they share to color the mesh points; it mixes C, M, Y and K as inks. When the models differ, the
|
||||
colors mix in display RGB and are stored in the working RGB space, and a CMYK document stores them as CMYK through the
|
||||
color settings. `fill` also expands pattern fills: each
|
||||
becomes the pattern's tiles that reach the object's box, placed by the pattern's transform, in a clip group shaped like
|
||||
the object that isolates their blending, with the fill's opacity, blend mode and effects; the object's other fills
|
||||
and strokes stay on copies of it in paint order. The tiles' stroke weights and effect distances scale with the
|
||||
@@ -1841,7 +1847,7 @@ box, as the canvas paints the fill; the expanded art does not keep them. With `f
|
||||
stay live. `object.expand.info` answers which options have something to expand in the selection
|
||||
(`{object, fill, stroke, gradient}`; `gradient` says whether Fill has a gradient fill, which Expand Gradient To
|
||||
applies to), and `object.mesh.create` on a gradient-filled object colours the mesh points as the
|
||||
gradient paints them.
|
||||
gradient paints them, with the colors Object › Expand gives them.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"object.expand","params":{"stroke":false,"gradient":"mesh"}}}
|
||||
|
||||
@@ -658,6 +658,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Stroke visibility (#1253):** adding paint to a previously unpainted zero-width stroke restores the existing 1 pt default (`PaintDefaults::default`, `Appearance::set_stroke`), for the selected appearance item, the new-art defaults and Swap Fill/Stroke. Positive widths are kept; recoloring a painted zero-width stroke keeps its explicit zero. A real Eyedropper-to-new-shape sequence reproduces the zero-width inheritance. Five engine regressions cover creation, defaults, targeted items, preserved widths and one-step Undo/Redo (`crates/engine/tests/stroke_visibility.rs`).
|
||||
- **Gradients:** lossless, validated gradient params; gradients follow rotate, reflect, shear, non-uniform scale and distortions; the Gradient tool edits the fill or stroke of the active proxy, type included; an interactive on-canvas annotator (move, length/angle, rotate, add/move/delete/duplicate stops, midpoints, a stop popover, Delete and arrow keys). The Gradient panel has the Fill/Stroke proxy, a gradient-swatch dropdown with Save to Swatches, midpoint locations, Alt-drag to copy or swap stops, swatch drops on the ramp and a stop eyedropper; copied appearances and graphic styles place gradients on each target's own bounds; gradient handles snap and honour Constrain Angle. Gradient stops stay linked to global and spot swatches. Freeform gradients (points and lines) are edited on the canvas; radial gradients have an extent ellipse, an aspect handle and an off-centre focal point (SVG `fx`/`fy`, PDF two-point radials). A stroke's gradient runs within, along or across it. Object ▸ Expand turns gradients into N objects or a gradient mesh.
|
||||
With a gradient stop or a freeform gradient point selected, Alt-clicking a color swatch in the Swatches panel recolors it instead of the inactive Fill or Stroke.
|
||||
- **Freeform gradient colors in their own model:** Object ▸ Expand and Object ▸ Create Gradient Mesh (`object.mesh.create`) mix a freeform gradient's points in the color model they share: points of C50 M20 Y0 K10 give mesh points of C50 M20 Y0 K10, and RGB points keep their values in a working RGB space other than sRGB. Points in different models mix in display RGB, and a CMYK document stores the result as CMYK through the color settings. Points colored along CMYK stops (`paint.editGradient {stops}`, or a CMYK gradient switched to freeform) are CMYK, and so are a point `paint.freeform.splitLine` adds between CMYK points and a point `paint.freeform.addPoint` adds without `color` to CMYK points. Public reference: [Gradients](https://web.archive.org/web/20250714042311/https://helpx.adobe.com/illustrator/using/gradients.html) and [Meshes](https://web.archive.org/web/20250812201019/https://helpx.adobe.com/illustrator/using/meshes.html), which do not state how colors in different models mix; the rule is VectorCraft's own.
|
||||
- **Strokes:** one stroke-geometry module shared by the canvas, SVG, PDF and Outline Stroke; dotted lines (zero-length dashes draw dots or squares); arrowheads with hollow outlines, tip-on-end or extend-past-end alignment and one opacity for line and head. SVG and PDF export arrowheads, width profiles, brushes and aligned strokes exactly as the canvas draws them; Outline Stroke and the live Outline Stroke effect outline every stroke item as drawn (dashes, heads, profiles, alignment); dashes can be fitted to corners and path ends; width profiles carry through dashes, and their corners take the join. The Stroke panel edits type's character strokes, follows the stroke units (its weight presets are round values in that unit: `0.25 mm`, `0.0625 in`, `1 px`, #426; fields show four decimals in mm, cm and inches, three in points), shows mixed values blank and opens from the Control bar. A width profile library, thirty more arrowheads, and Width Point Edit with multi-select and discontinuous points. Visual bounds and clicks cover the whole painted stroke. Scale Strokes & Effects, Scale Corners and Use Preview Bounds work everywhere, and new art inherits stroke options, a graphic style or the whole last appearance.
|
||||
- **Brushes (part of #852):** double-clicking a brush in the Brushes panel (or the panel menu's Brush Options…) opens Calligraphic Brush Options (Name; Angle, Roundness and Size, each Fixed, Random or Pressure with its Variation; live previews of the nib and of a light–heavy–light stroke) or Bristle Brush Options (Shape and the bristle sliders); OK edits the brush and every stroke painted with it. The Paintbrush records the pen pressure along each stroke (kept with the path, saved, and joined when a stroke continues a path); a Calligraphic value on Pressure goes from value − variation at the lightest pressure to value + variation at the heaviest, on the canvas and in SVG, PDF and the other exports. Brushes saved before keep their look. Scatter Brush Options (Size, Spacing, Scatter and Rotation, each Fixed, Random between two values or Pressure from the first at the lightest pressure to the second at the heaviest; Rotation relative to Page or Path), Art Brush Options (Width, Scale Proportionately, Stretch to Fit Stroke Length or Stretch Between Guides with the guides' start and end, the four Directions, Flip Along and Across) and Pattern Brush Options (Scale, Spacing, the five tiles shown, Flip Along and Across, Stretch to fit, Add space to fit or Approximate path) each have Colorization (None, Tints, Tints and Shades, Hue Shift with its Key Color picked from the art's colours) and a live stroke preview; values from files and commands are clamped to their ranges. Still to come: the Art brush's Overlap, auto-generated Pattern brush corners, new tile art picked in Pattern Brush Options, Stylus Wheel, Tilt, Bearing and Rotation, and pen pressure on macOS.
|
||||
In the Brushes panel, Shift-click selects a range of brushes and Ctrl/Cmd-click adds or removes one. Delete Brush and Duplicate Brush then act on all of them (`brush.delete {names}`, `brush.duplicate {names}`).
|
||||
|
||||
Reference in New Issue
Block a user