tawasuyu/llimphi
Sovereign retained-mode GPU UI framework in Rust (wgpu+vello+taffy+parley), Elm loop, 40+ widgets.
⎇ main
shared/foreign-lottie/src/schema/shapes/base_gradient.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
1// Copyright 2024 the Velato Authors
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3
4use crate::schema::animated_properties::gradient_colors::GradientColors;
5use crate::schema::animated_properties::multi_dimensional::MultiDimensional;
6use crate::schema::animated_properties::value::FloatValue;
7use crate::schema::constants::gradient_type::GradientType;
8
9use serde::{Deserialize, Serialize};
10
11#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
12/// Represents a gradient.
13pub struct BaseGradientShape {
14 /// Describes the gradient colors.
15 #[serde(rename = "g")]
16 pub colors: GradientColors,
17
18 /// Describes the starting point for the gradient.
19 #[serde(rename = "s")]
20 pub start_point: MultiDimensional,
21
22 /// Describes the end point for the gradient.
23 #[serde(rename = "e")]
24 pub end_point: MultiDimensional,
25
26 /// Indicates the type of the gradient.
27 #[serde(rename = "t")]
28 pub gradient_type: Option<GradientType>,
29
30 /// Represents the highlight length as a percentage between start and end
31 /// points.
32 #[serde(rename = "h")]
33 pub highlight_length: Option<FloatValue>,
34
35 /// Specifies the highlight angle relative to the direction from start to
36 /// end points.
37 #[serde(rename = "a")]
38 pub highlight_angle: Option<FloatValue>,
39}