figma_api/models/
rgba.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/// Rgba : An RGBA color
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Rgba {
17    /// Red channel value, between 0 and 1.
18    #[serde(rename = "r")]
19    pub r: f64,
20    /// Green channel value, between 0 and 1.
21    #[serde(rename = "g")]
22    pub g: f64,
23    /// Blue channel value, between 0 and 1.
24    #[serde(rename = "b")]
25    pub b: f64,
26    /// Alpha channel value, between 0 and 1.
27    #[serde(rename = "a")]
28    pub a: f64,
29}
30
31impl Rgba {
32    /// An RGBA color
33    pub fn new(r: f64, g: f64, b: f64, a: f64) -> Rgba {
34        Rgba {
35            r,
36            g,
37            b,
38            a,
39        }
40    }
41}
42