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
//! Palette crate integration.
//!
//! Provides bidirectional conversion between [`Color`](crate::Color)
//! and [`palette::Srgb<u8>`](::palette::Srgb).
//!
//! Both types store sRGB u8 channels, so the conversion is lossless.
//!
//! # Examples
//!
//! ```ignore
//! use prismatica::crameri::BATLOW;
//!
//! let color = BATLOW.eval(0.5);
//! let srgb: palette::Srgb<u8> = color.into();
//! let back: prismatica::Color = srgb.into();
//! assert_eq!(color, back); // lossless u8 roundtrip
//! ```
use crateColor;
use crateimpl_into_framework_color;
/// Convert a prismatica [`Color`] to a [`palette::Srgb<u8>`](::palette::Srgb).
///
/// # Examples
///
/// ```ignore
/// let color = prismatica::Color::new(128, 64, 32);
/// let srgb: palette::Srgb<u8> = color.into();
/// assert_eq!(srgb.red, 128);
/// ```
/// Convert a [`palette::Srgb<u8>`](::palette::Srgb) to a prismatica [`Color`].
///
/// # Examples
///
/// ```ignore
/// let srgb = palette::Srgb::new(128u8, 64, 32);
/// let color: prismatica::Color = srgb.into();
/// assert_eq!(color.r, 128);
/// ```
impl_into_framework_color!;