| 1 | #[repr (C)] |
| 2 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
| 3 | #[cfg_attr (feature = "defmt-03" , derive(defmt::Format))] |
| 4 | #[derive (Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)] |
| 5 | /// A `Red + Green + Blue + Alpha` pixel. |
| 6 | /// |
| 7 | /// # Examples |
| 8 | /// |
| 9 | /// ``` |
| 10 | /// use rgb::Rgba; |
| 11 | /// |
| 12 | /// let pixel: Rgba<u8> = Rgba { r: 0, g: 0, b: 0, a: 255 }; |
| 13 | /// ``` |
| 14 | pub struct Rgba<T, A = T> { |
| 15 | /// Red Component |
| 16 | pub r: T, |
| 17 | /// Green Component |
| 18 | pub g: T, |
| 19 | /// Blue Component |
| 20 | pub b: T, |
| 21 | /// Alpha Component |
| 22 | pub a: A, |
| 23 | } |
| 24 | |