figma_api/models/
multitone_noise_effect.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 MultitoneNoiseEffect {
16    /// Blend mode of the noise effect
17    #[serde(rename = "blendMode")]
18    pub blend_mode: models::BlendMode,
19    /// The size of the noise effect
20    #[serde(rename = "noiseSize")]
21    pub noise_size: f64,
22    /// The density of the noise effect
23    #[serde(rename = "density")]
24    pub density: f64,
25    /// The string literal 'MULTITONE' representing the noise type.
26    #[serde(rename = "noiseType")]
27    pub noise_type: NoiseType,
28    /// The opacity of the noise effect
29    #[serde(rename = "opacity")]
30    pub opacity: f64,
31}
32
33impl MultitoneNoiseEffect {
34    pub fn new(blend_mode: models::BlendMode, noise_size: f64, density: f64, noise_type: NoiseType, opacity: f64) -> MultitoneNoiseEffect {
35        MultitoneNoiseEffect {
36            blend_mode,
37            noise_size,
38            density,
39            noise_type,
40            opacity,
41        }
42    }
43}
44/// The string literal 'MULTITONE' representing the noise type.
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum NoiseType {
47    #[serde(rename = "MULTITONE")]
48    Multitone,
49}
50
51impl Default for NoiseType {
52    fn default() -> NoiseType {
53        Self::Multitone
54    }
55}
56