Skip to content

Commit

Permalink
Clarifying gradient value (lottie#111)
Browse files Browse the repository at this point in the history
* Add pucker/bloat modifier

* Clarifying gradient value

* Revert "Add pucker/bloat modifier"

This reverts commit 4ff761c.

---------

Co-authored-by: Mattia Basaglia <[email protected]>
  • Loading branch information
b-wils and mbasaglia authored Nov 27, 2024
1 parent 57ac706 commit 2f357f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/specs/values.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ RGB component.
<h2 id="gradient">Gradient</h2>

The gradient appearance is specified in terms of color stops and opacity stops.
Color stops are defined as `(position, color)` tuples, where the position is a normalized `[0..1]`value along the gradient axis `[startpoint -> endpoint]`, and the color is 3 floats representing the RGB components. Transparency (opacity) stops are defined as `(position, transparency)` tuples, where position is similar to color stops' position.
Color stops are defined as `(position, color)` tuples, where the position is a normalized `[0..1]`value along the gradient axis `[startpoint -> endpoint]`, and the color is 3 floats representing the RGB components. Transparency (opacity) stops are defined as `(position, transparency)` tuples, where the position is a normalized `[0..1]`value along the gradient axis `[startpoint -> endpoint]`, and transparency is a `[0..1]` value.

All color and opacity stops are stored sequentially by ascending offsets in a flattened float array (color stops followed by opacity stops), with 4 floats per color stop and 2 floats per opacity stops. Thus, given color stops and opacity stops, the expected size for the gradient data array is `4 * Nc + 2 * No`.

The color stop count is typically specified in a separate field from the gradient values, while the count of opacity stops can be inferred from the data array length: `No = (length - 4 * Nc)/2`.
The color stop count MUST be specified in a separate field from the gradient values, while the count of opacity stops can be inferred from the data array length: `No = (length - 4 * Nc)/2`.

<h3>Gradient without transparency</h3>

Expand Down

0 comments on commit 2f357f0

Please sign in to comment.