figma_api/models/
solid_paint.rs

1/*
2 * Figma API
3 *
4 * 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).
5 *
6 * The version of the OpenAPI document: 0.31.0
7 * Contact: support@figma.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SolidPaint {
16    /// Is the paint enabled?
17    #[serde(rename = "visible", skip_serializing_if = "Option::is_none")]
18    pub visible: Option<bool>,
19    /// Overall opacity of paint (colors within the paint can also have opacity values which would blend with this)
20    #[serde(rename = "opacity", skip_serializing_if = "Option::is_none")]
21    pub opacity: Option<f64>,
22    /// How this node blends with nodes behind it in the scene
23    #[serde(rename = "blendMode")]
24    pub blend_mode: models::BlendMode,
25    /// The string literal \"SOLID\" representing the paint's type. Always check the `type` before reading other properties.
26    #[serde(rename = "type")]
27    pub r#type: Type,
28    /// Solid color of the paint
29    #[serde(rename = "color")]
30    pub color: Box<models::Rgba>,
31    #[serde(rename = "boundVariables", skip_serializing_if = "Option::is_none")]
32    pub bound_variables: Option<Box<models::SolidPaintAllOfBoundVariables>>,
33}
34
35impl SolidPaint {
36    pub fn new(blend_mode: models::BlendMode, r#type: Type, color: models::Rgba) -> SolidPaint {
37        SolidPaint {
38            visible: None,
39            opacity: None,
40            blend_mode,
41            r#type,
42            color: Box::new(color),
43            bound_variables: None,
44        }
45    }
46}
47/// The string literal \"SOLID\" representing the paint's type. Always check the `type` before reading other properties.
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum Type {
50    #[serde(rename = "SOLID")]
51    Solid,
52}
53
54impl Default for Type {
55    fn default() -> Type {
56        Self::Solid
57    }
58}
59