1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use crateRGBA;
/// RGB color with three 0..1 float channels.
///
/// This is a tuple struct with public fields:
///
/// | Field | Range | Description |
/// |-------|--------|--------------|
/// | `.0` | 0..1 | Red channel |
/// | `.1` | 0..1 | Green channel |
/// | `.2` | 0..1 | Blue channel |
///
/// # Arithmetic
///
/// `RGB` implements [`Add`], [`Sub`], [`Mul`] (componentwise), [`Mul<f32>`],
/// and [`Div<f32>`] via the [`ChannelArray<3>`] impl. These operate on all
/// three channels independently.
///
/// # Conversions
///
/// ```
/// use optic_color::*;
///
/// let rgb = RGB(0.5, 0.2, 0.8);
/// let rgba: RGBA = rgb.into(); // alpha = 1.0
/// let rgba = rgb.to_rgba(0.5); // custom alpha
/// let arr: [f32; 3] = rgb.into(); // flatten
/// ```
///
/// See also [`RGBA`], [`HSV`], [`HSL`].
;