1
1
#![ warn( missing_docs) ]
2
2
3
- //! Simple colorspace conversions in pure Rust.
3
+ //! Comprehensive colorspace conversions in pure Rust
4
+ //!
5
+ //! The working data structure is `[DType; ValidChannels]`, where DType is one of
6
+ //! `f32` or `f64` and ValidChannels is either 3 or 4, with the 4th channel representing
7
+ //! alpha and being unprocessed outside of typing conversions
4
8
//!
5
- //! All conversions are in-place, except when converting to/from integer and hexadecimal.
6
9
//! Formulae are generally taken from their research papers or Wikipedia and validated against
7
10
//! colour-science <https://github.com/colour-science/colour>
8
11
//!
@@ -17,9 +20,11 @@ use core::ops::{Add, Div, Mul, Neg, Rem, Sub};
17
20
18
21
// DType {{{
19
22
20
- /// 3 channels, or 4 with alpha. Alpha ignored.
23
+ /// 3 channels, or 4 with alpha.
24
+ /// Alpha ignored during space conversions.
21
25
pub struct Channels < const N : usize > ;
22
- /// 3 channels, or 4 with alpha. Alpha ignored.
26
+ /// 3 channels, or 4 with alpha.
27
+ /// Alpha ignored during space conversions.
23
28
pub trait ValidChannels { }
24
29
impl ValidChannels for Channels < 3 > { }
25
30
impl ValidChannels for Channels < 4 > { }
@@ -921,7 +926,7 @@ fn rm_paren<'a>(s: &'a str) -> &'a str {
921
926
///
922
927
/// Can additionally be set as a % of SDR range.
923
928
///
924
- /// Does not support alpha channel .
929
+ /// Alpha will be NaN if only 3 values are provided .
925
930
///
926
931
/// # Examples
927
932
///
0 commit comments