Skip to main content

geop_core_math/primitives/
color.rs

1#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2pub enum Color10 {
3    Blue,
4    Orange,
5    Green,
6    Red,
7    Purple,
8    Brown,
9    Pink,
10    Gray,
11    Olive,
12    Cyan,
13    DarkGray,
14}
15
16impl Color10 {
17    pub fn to_hex(self) -> u32 {
18        match self {
19            Color10::Blue => 0x4472C4,
20            Color10::Orange => 0xED7D31,
21            Color10::Green => 0x70AD47,
22            Color10::Red => 0xFF0000,
23            Color10::Purple => 0x7030A0,
24            Color10::Brown => 0x833C00,
25            Color10::Pink => 0xFF99CC,
26            Color10::Gray => 0x808080,
27            Color10::Olive => 0x808000,
28            Color10::Cyan => 0x00B0F0,
29            Color10::DarkGray => 0x3C3C3C,
30        }
31    }
32}