Skip to content

Commit 75d3922

Browse files
committed
Update docs/readme for generics
1 parent 521219b commit 75d3922

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ColCon 0.9.0
2-
Simple colorspace conversions in Rust.
2+
Comprehensive colorspace conversions in Rust.
33

44
## Features
55
* Pure Rust, no dependencies.

src/lib.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#![warn(missing_docs)]
22

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
48
//!
5-
//! All conversions are in-place, except when converting to/from integer and hexadecimal.
69
//! Formulae are generally taken from their research papers or Wikipedia and validated against
710
//! colour-science <https://github.com/colour-science/colour>
811
//!
@@ -17,9 +20,11 @@ use core::ops::{Add, Div, Mul, Neg, Rem, Sub};
1720

1821
// DType {{{
1922

20-
/// 3 channels, or 4 with alpha. Alpha ignored.
23+
/// 3 channels, or 4 with alpha.
24+
/// Alpha ignored during space conversions.
2125
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.
2328
pub trait ValidChannels {}
2429
impl ValidChannels for Channels<3> {}
2530
impl ValidChannels for Channels<4> {}
@@ -921,7 +926,7 @@ fn rm_paren<'a>(s: &'a str) -> &'a str {
921926
///
922927
/// Can additionally be set as a % of SDR range.
923928
///
924-
/// Does not support alpha channel.
929+
/// Alpha will be NaN if only 3 values are provided.
925930
///
926931
/// # Examples
927932
///

0 commit comments

Comments
 (0)