mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 19:24:42 +00:00
Merge pull request #6903 from dotCooCoo/feat/gradient-repeat
Gradients: repeat or reflect a gradient's stops a set number of times
This commit is contained in:
+3
-3
@@ -414,9 +414,9 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
|
||||
- **Done:** COLR colour fonts (v0 and v1): a glyph's layers are vector art (solid colours, linear and radial
|
||||
gradients, clips, blend modes, palette 0, the foreground colour from the run's fill), placed with the type, drawn on
|
||||
the canvas, written as paths in SVG, EPS, legacy `.ai` and PDF with outlined text, as text in PDF, and editable
|
||||
paths with Create Outlines. Limits: glyphs using sweep gradients, Porter-Duff compositing, radial gradients from a
|
||||
circle that isn't the centre, or repeating gradients are images of the glyph until documents have those paints;
|
||||
estimate unchanged.
|
||||
paths with Create Outlines. Limits: glyphs using sweep gradients, Porter-Duff compositing or radial gradients from a
|
||||
circle that isn't the centre are images of the glyph until documents have those paints, and glyphs using repeating
|
||||
or reflecting gradients are images until the color font reader maps them to a gradient's spread; estimate unchanged.
|
||||
- **Done:** OpenType SVG colour fonts: each glyph's SVG document is read by the SVG importer into vector art,
|
||||
in the run's colours where it uses `currentColor` (or the legacy `context-fill`/`context-stroke`), then drawn, exported and outlined as COLR
|
||||
glyphs are (PDF real text writes them as text that draws nothing, their art drawn where they sit). Images in glyph documents
|
||||
|
||||
+36
-1
@@ -817,7 +817,7 @@ symbol (named after its `data-name`, else its id) with an instance per `<use>`;
|
||||
symbol with strokes) stays art. `feGaussianBlur`, `feDropShadow` and the usual shadow chains (offset, blur, flood or
|
||||
colour matrix, composite, merge) become Gaussian Blur, Drop Shadow, Outer Glow, Inner Glow and Feather effects; other
|
||||
filters are listed in `warnings`. Undisplayed objects (`display:none`) come back hidden, nested clip paths intersect,
|
||||
and reflected or repeated gradients (`spreadMethod`) are expanded into stops. `<image>` files (relative links are
|
||||
and reflected or repeated gradients (`spreadMethod`) import as gradients that repeat or reflect (see Spread under Examples). `<image>` files (relative links are
|
||||
found in the SVG's folder; only files on this computer or the SVG's network share are read, and pasted SVG reads only
|
||||
absolute paths) stay linked images (see Linked images); SVG files and `data:` SVGs become art; a file that
|
||||
can't be read becomes a placeholder in its box, named in `warnings` and `missingLinks`.
|
||||
@@ -1166,6 +1166,41 @@ another form gives a warning:
|
||||
{"name":"run_command","arguments":{"command":"paint.setFill","params":{"gradient":{"kind":"diamond","start":[150,150],"end":[200,150],"aspect":60}}}}
|
||||
```
|
||||
|
||||
Spread (the Gradient panel's menu, beside a Repeats field) says what a linear, radial, conic or diamond gradient
|
||||
paints past the ends of its stops. `pad` (the default) carries the first and last colors on. `repeat` and `reflect`
|
||||
run the stops `repeats` times along the vector (1 to 100, VectorCraft's own limit; default 1) and keep going past
|
||||
both ends of it, `repeat` starting the stops again each time and `reflect` running every other run backwards. A
|
||||
radial or diamond gradient repeats in rings or squares out from its center (an off-center radial's rings grow about
|
||||
its focal point), and a conic one repeats around the turn. A freeform gradient has no ends, so a `spread` other
|
||||
than `pad` is an error for one, and so is a `repeats` that is not a whole number from 1 to 100. Both edit as one
|
||||
undo step, and an edit that changes nothing records none. A gradient set back to `pad` keeps its count for later,
|
||||
and it matches a preset or swatch of the same gradient whatever count it keeps. The Gradient tool marks each place
|
||||
along the bar where one run meets the next (on a conic, across its extent ellipse). A gradient along or across a
|
||||
stroke runs its stops `repeats` times along or across it, a blend between two gradients that repeat (or reflect)
|
||||
steps the count from one to the other, and a gradient swatch saved as CSS gets its stops repeated across the box. The
|
||||
Gradient tool's stop and midpoint markers lie along the whole bar, as on the Gradient panel's slider, and edit the
|
||||
stops of one run.
|
||||
|
||||
SVG export writes `spreadMethod` with the gradient's vector shortened to one run
|
||||
(https://www.w3.org/TR/SVG2/pservers.html), and SVG import reads
|
||||
`spreadMethod` as the spread, with a count of 1. CSS writes `repeating-linear-gradient` and `repeating-radial-gradient` over one run, or
|
||||
one run and its mirror for `reflect` (https://www.w3.org/TR/css-images-3/#repeating-gradients), and a conic gradient
|
||||
with its stops repeated around the turn. PDF writes a conic gradient's sweep shading over one run, repeated or
|
||||
reflected past it. PDF, EPS and legacy `.ai` gradients pad past their ends, so a linear, radial or diamond gradient
|
||||
is written with its stops repeated as many times as the shape needs: at most 256 runs and 16,384 stops (256 stops in
|
||||
legacy `.ai`), and for a radial or diamond gradient no farther from its center than 65,536 runs, or than a million
|
||||
times the smallest gap between its stops (measured in runs) when that is less. Past those it pads, with a warning.
|
||||
The `.ai` editing data has no spread either: it holds the stops repeated across the shape, at most 256 of them, with
|
||||
a warning. PDF import finds a sharp step between two colors in an axial or radial shading, in any PDF, by halving
|
||||
the spans between its samples, so the step reads back where it is in the file (to 1/64 × 2^-14 of the axis, with at
|
||||
most 16,384 samples a shading) instead of blurred across the samples around it. Object › Expand expands the
|
||||
repeated stops, into the same whole number of `steps` objects for each run (at least one, so about `steps` in all),
|
||||
each run starting on an object's edge:
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"paint.editGradient","params":{"spread":"reflect","repeats":3}}}
|
||||
```
|
||||
|
||||
Dither (the Gradient panel's box) draws a linear, radial, conic or diamond gradient fill with fine noise that hides
|
||||
banding; SVG and PDF exports write such a fill as an image at the Document Raster Effects resolution. It applies to
|
||||
fills (`stroke: true` is refused):
|
||||
|
||||
@@ -1349,6 +1349,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- The Gradient panel's Delete Stop sits at the right end of the ramp, level with it, so a panel too short to show the stop fields still shows it; it deletes the selected stop (never below two), as dragging a stop down off the ramp does (#5403).
|
||||
- Conic gradients, VectorCraft's own gradient type: the stops sweep once around the center from the vector, clockwise on the page (a negative aspect, or a reflection, turns the sweep the other way), with a Conic button in the Gradient panel's Type row and the Gradient tool's extent ellipse and aspect handle; they follow transforms, Expand into wedges or a mesh, open from `.af` files, and export to PDF as a function-based shading that PDF import reads back as a conic gradient; SVG, EPS and legacy `.ai` files get solid wedges, and CSS a `conic-gradient`.
|
||||
- Diamond gradients, VectorCraft's own gradient type: the stops run from the center out to a square with a corner at the end of the vector (the aspect stretches it into a rhombus), with a Diamond button in the Gradient panel's Type row and the Gradient tool's square and aspect handle; they follow transforms, Expand into nested squares or a mesh, and export to PDF, SVG, EPS and legacy `.ai` as four linear gradients, one for each quarter of the square (an image in PDF and SVG for translucent stops, a dithered fill, the Perceptual method other than spot color shadings in PDF, or a square with no area), and on type characters in SVG as a radial gradient; PDF import reads a function-based shading whose color is the same along each square about its origin as a diamond gradient.
|
||||
- Gradient spread, VectorCraft's own setting: Pad, Repeat or Reflect, with a Repeats count of 1 to 100, in the Gradient panel and on `paint.editGradient` and `paint.setFill`; Repeat and Reflect run a linear, radial, conic or diamond gradient's stops that many times along the vector and on past its ends, the Gradient tool marks where the runs meet, and SVG writes and reads `spreadMethod`, CSS writes repeating gradients, PDF writes a conic's sweep shading over one run and the other kinds with their stops repeated across the shape, as EPS, legacy `.ai` and the `.ai` editing data do.
|
||||
- The stop popover a double-click on a stop opens (the Gradient tool's annotator or the Gradient panel) has an eyedropper beside its Color and Swatches tabs: it closes the popover and samples the next colour clicked on the art into the stop, as the Gradient panel's eyedropper does (#4681).
|
||||
Cmd/Ctrl-click on the Gradient panel's Gradient Fill box or on the Tools panel's Gradient button resets the gradient of the active Fill or Stroke to the linear White, Black gradient, as one undo step ([Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html)).
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user