Skip to content

LottieSlot: Gradient sample enhancement - #67

Merged
hermet merged 1 commit into
mainfrom
jinny/slot-gradient++
Aug 27, 2026
Merged

LottieSlot: Gradient sample enhancement#67
hermet merged 1 commit into
mainfrom
jinny/slot-gradient++

Conversation

@tinyjin

@tinyjin tinyjin commented Aug 26, 2026

Copy link
Copy Markdown
Member

added gradient geometry and opacity

CleanShot 2026-08-26 at 15 05 47
"gradient_fill":{"p":{"p":2,"k":{"k":[0,0.1,0.1,0.2,1,1,0.1,0.2,0,0,1,1]}}},
"gradient_opacity":{"p":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[100],"t":0},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[30],"t":60},{"s":[100],"t":120}]}},
"gradient_start":{"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"s":[-80,-40],"t":0},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"s":[80,40],"t":60},{"s":[-80,-40],"t":120}]}},
"gradient_end":{"p":{"a":0,"k":[110,0]}},
"gradient_height":{"p":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[0],"t":0},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[90],"t":60},{"s":[0],"t":120}]}},
"gradient_angle":{"p":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"s":[0],"t":0},{"s":[360],"t":120}]}}

added gradient geometry and opacity
@tinyjin tinyjin self-assigned this Aug 26, 2026
@tinyjin tinyjin added the enhancement Improve examples label Aug 26, 2026
@tinyjin
tinyjin marked this pull request as ready for review August 27, 2026 04:11
@tinyjin
tinyjin requested a review from hermet as a code owner August 27, 2026 04:11
Copilot AI lite review requested due to automatic review settings August 27, 2026 04:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the ThorVG Lottie “slot” example for gradients by expanding the sample slot payload and updating the corresponding Lottie asset so the gradient’s color stops, opacity, and geometry-related properties can be overridden via slots.

Changes:

  • Expanded the gradient slot sample JSON in LottieSlot.cpp to include fill stops, opacity, start/end points, height, and angle.
  • Updated slot1.json to attach sid values for the corresponding gradient properties (including opacity and geometry fields).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/LottieSlot.cpp Extends the gradient slot example payload to cover additional gradient properties.
res/lottie/extensions/slot1.json Updates the gradient fill object to expose more properties via slot sids (opacity/start/end/height/angle).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/LottieSlot.cpp
@hermet
hermet requested a review from Nor-s August 27, 2026 15:37
@hermet
hermet merged commit ff4822b into main Aug 27, 2026
3 checks passed
@hermet
hermet deleted the jinny/slot-gradient++ branch August 27, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improve examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants