figma_api/models/
blend_mode.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/// BlendMode : This type is a string enum with the following possible values  Normal blends: - `PASS_THROUGH` (only applicable to objects with children) - `NORMAL`  Darken: - `DARKEN` - `MULTIPLY` - `LINEAR_BURN` - `COLOR_BURN`  Lighten: - `LIGHTEN` - `SCREEN` - `LINEAR_DODGE` - `COLOR_DODGE`  Contrast: - `OVERLAY` - `SOFT_LIGHT` - `HARD_LIGHT`  Inversion: - `DIFFERENCE` - `EXCLUSION`  Component: - `HUE` - `SATURATION` - `COLOR` - `LUMINOSITY`
15/// This type is a string enum with the following possible values  Normal blends: - `PASS_THROUGH` (only applicable to objects with children) - `NORMAL`  Darken: - `DARKEN` - `MULTIPLY` - `LINEAR_BURN` - `COLOR_BURN`  Lighten: - `LIGHTEN` - `SCREEN` - `LINEAR_DODGE` - `COLOR_DODGE`  Contrast: - `OVERLAY` - `SOFT_LIGHT` - `HARD_LIGHT`  Inversion: - `DIFFERENCE` - `EXCLUSION`  Component: - `HUE` - `SATURATION` - `COLOR` - `LUMINOSITY`
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum BlendMode {
18    #[serde(rename = "PASS_THROUGH")]
19    PassThrough,
20    #[serde(rename = "NORMAL")]
21    Normal,
22    #[serde(rename = "DARKEN")]
23    Darken,
24    #[serde(rename = "MULTIPLY")]
25    Multiply,
26    #[serde(rename = "LINEAR_BURN")]
27    LinearBurn,
28    #[serde(rename = "COLOR_BURN")]
29    ColorBurn,
30    #[serde(rename = "LIGHTEN")]
31    Lighten,
32    #[serde(rename = "SCREEN")]
33    Screen,
34    #[serde(rename = "LINEAR_DODGE")]
35    LinearDodge,
36    #[serde(rename = "COLOR_DODGE")]
37    ColorDodge,
38    #[serde(rename = "OVERLAY")]
39    Overlay,
40    #[serde(rename = "SOFT_LIGHT")]
41    SoftLight,
42    #[serde(rename = "HARD_LIGHT")]
43    HardLight,
44    #[serde(rename = "DIFFERENCE")]
45    Difference,
46    #[serde(rename = "EXCLUSION")]
47    Exclusion,
48    #[serde(rename = "HUE")]
49    Hue,
50    #[serde(rename = "SATURATION")]
51    Saturation,
52    #[serde(rename = "COLOR")]
53    Color,
54    #[serde(rename = "LUMINOSITY")]
55    Luminosity,
56
57}
58
59impl std::fmt::Display for BlendMode {
60    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
61        match self {
62            Self::PassThrough => write!(f, "PASS_THROUGH"),
63            Self::Normal => write!(f, "NORMAL"),
64            Self::Darken => write!(f, "DARKEN"),
65            Self::Multiply => write!(f, "MULTIPLY"),
66            Self::LinearBurn => write!(f, "LINEAR_BURN"),
67            Self::ColorBurn => write!(f, "COLOR_BURN"),
68            Self::Lighten => write!(f, "LIGHTEN"),
69            Self::Screen => write!(f, "SCREEN"),
70            Self::LinearDodge => write!(f, "LINEAR_DODGE"),
71            Self::ColorDodge => write!(f, "COLOR_DODGE"),
72            Self::Overlay => write!(f, "OVERLAY"),
73            Self::SoftLight => write!(f, "SOFT_LIGHT"),
74            Self::HardLight => write!(f, "HARD_LIGHT"),
75            Self::Difference => write!(f, "DIFFERENCE"),
76            Self::Exclusion => write!(f, "EXCLUSION"),
77            Self::Hue => write!(f, "HUE"),
78            Self::Saturation => write!(f, "SATURATION"),
79            Self::Color => write!(f, "COLOR"),
80            Self::Luminosity => write!(f, "LUMINOSITY"),
81        }
82    }
83}
84
85impl Default for BlendMode {
86    fn default() -> BlendMode {
87        Self::PassThrough
88    }
89}
90