mirror of
https://codeberg.org/icewind/contrast.git
synced 2026-06-03 09:54:19 +02:00
clippy fixes
This commit is contained in:
parent
df75443995
commit
938d4e99e8
1 changed files with 5 additions and 7 deletions
12
src/lib.rs
12
src/lib.rs
|
|
@ -32,13 +32,11 @@ fn scale_channel<T: Bounded + NumCast, F: Float + NumCast + Div>(channel: T) ->
|
|||
/// # Usage
|
||||
///
|
||||
/// ```rust
|
||||
/// use contrast::contrast;
|
||||
/// use rgb::RGB8;
|
||||
///
|
||||
/// fn main() {
|
||||
/// let contrast: f32 = contrast(RGB8::from([255, 255, 255]), RGB8::from([255, 255, 0]));
|
||||
/// assert_eq!(contrast, 1.0738392);
|
||||
/// }
|
||||
/// # use contrast::contrast;
|
||||
/// # use rgb::RGB8;
|
||||
/// #
|
||||
/// let contrast: f32 = contrast(RGB8::from([255, 255, 255]), RGB8::from([255, 255, 0]));
|
||||
/// assert_eq!(contrast, 1.0738392);
|
||||
/// ```
|
||||
pub fn contrast<T: Bounded + NumCast, F: Float + NumCast + Div>(a: RGB<T>, b: RGB<T>) -> F {
|
||||
let luminance_a: F = luminance::<T, F>(a) + cast::<_, F>(0.05).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue