1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Figma API
*
* This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api). Note: we are releasing the OpenAPI specification as a beta given the large surface area and complexity of the REST API. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues).
*
* The version of the OpenAPI document: 0.31.0
* Contact: support@figma.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DropShadowEffect {
/// The color of the shadow
#[serde(rename = "color")]
pub color: Box<models::Rgba>,
/// Blend mode of the shadow
#[serde(rename = "blendMode")]
pub blend_mode: models::BlendMode,
/// How far the shadow is projected in the x and y directions
#[serde(rename = "offset")]
pub offset: Box<models::Vector>,
/// Radius of the blur effect (applies to shadows as well)
#[serde(rename = "radius")]
pub radius: f64,
/// The distance by which to expand (or contract) the shadow. For drop shadows, a positive `spread` value creates a shadow larger than the node, whereas a negative value creates a shadow smaller than the node. For inner shadows, a positive `spread` value contracts the shadow. Spread values are only accepted on rectangles and ellipses, or on frames, components, and instances with visible fill paints and `clipsContent` enabled. When left unspecified, the default value is 0.
#[serde(rename = "spread", skip_serializing_if = "Option::is_none")]
pub spread: Option<f64>,
/// Whether this shadow is visible.
#[serde(rename = "visible")]
pub visible: bool,
#[serde(rename = "boundVariables", skip_serializing_if = "Option::is_none")]
pub bound_variables: Option<Box<models::BaseShadowEffectBoundVariables>>,
/// Whether to show the shadow behind translucent or transparent pixels
#[serde(rename = "showShadowBehindNode")]
pub show_shadow_behind_node: bool,
}
impl DropShadowEffect {
pub fn new(color: models::Rgba, blend_mode: models::BlendMode, offset: models::Vector, radius: f64, visible: bool, show_shadow_behind_node: bool) -> DropShadowEffect {
DropShadowEffect {
color: Box::new(color),
blend_mode,
offset: Box::new(offset),
radius,
spread: None,
visible,
bound_variables: None,
show_shadow_behind_node,
}
}
}