figma_api/models/has_mask_trait.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 HasMaskTrait {
16 /// Does this node mask sibling nodes in front of it?
17 #[serde(rename = "isMask", skip_serializing_if = "Option::is_none")]
18 pub is_mask: Option<bool>,
19 /// If this layer is a mask, this property describes the operation used to mask the layer's siblings. The value may be one of the following: - ALPHA: the mask node's alpha channel will be used to determine the opacity of each pixel in the masked result. - VECTOR: if the mask node has visible fill paints, every pixel inside the node's fill regions will be fully visible in the masked result. If the mask has visible stroke paints, every pixel inside the node's stroke regions will be fully visible in the masked result. - LUMINANCE: the luminance value of each pixel of the mask node will be used to determine the opacity of that pixel in the masked result.
20 #[serde(rename = "maskType", skip_serializing_if = "Option::is_none")]
21 pub mask_type: Option<MaskType>,
22 /// True if maskType is VECTOR. This field is deprecated; use maskType instead.
23 #[serde(rename = "isMaskOutline", skip_serializing_if = "Option::is_none")]
24 pub is_mask_outline: Option<bool>,
25}
26
27impl HasMaskTrait {
28 pub fn new() -> HasMaskTrait {
29 HasMaskTrait {
30 is_mask: None,
31 mask_type: None,
32 is_mask_outline: None,
33 }
34 }
35}
36/// If this layer is a mask, this property describes the operation used to mask the layer's siblings. The value may be one of the following: - ALPHA: the mask node's alpha channel will be used to determine the opacity of each pixel in the masked result. - VECTOR: if the mask node has visible fill paints, every pixel inside the node's fill regions will be fully visible in the masked result. If the mask has visible stroke paints, every pixel inside the node's stroke regions will be fully visible in the masked result. - LUMINANCE: the luminance value of each pixel of the mask node will be used to determine the opacity of that pixel in the masked result.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum MaskType {
39 #[serde(rename = "ALPHA")]
40 Alpha,
41 #[serde(rename = "VECTOR")]
42 Vector,
43 #[serde(rename = "LUMINANCE")]
44 Luminance,
45}
46
47impl Default for MaskType {
48 fn default() -> MaskType {
49 Self::Alpha
50 }
51}
52