Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework chromatic adaptation
Browse files Browse the repository at this point in the history
Ogeon committed Aug 1, 2024
1 parent 0a69512 commit 02743ec
Showing 6 changed files with 431 additions and 50 deletions.
4 changes: 0 additions & 4 deletions palette/README.md
Original file line number Diff line number Diff line change
@@ -215,7 +215,6 @@ use palette::{
encoding,
white_point,
rgb::Rgb,
chromatic_adaptation::AdaptFrom,
Srgb
};

@@ -227,9 +226,6 @@ type EqualEnergyStandard = (encoding::Srgb, white_point::E, encoding::Srgb);
type EqualEnergySrgb<T> = Rgb<EqualEnergyStandard, T>;

let ee_rgb = EqualEnergySrgb::new(1.0, 0.5, 0.3);

// We need to use chromatic adaptation when going between white points.
let srgb = Srgb::adapt_from(ee_rgb);
```

It's also possible to implement the traits for a custom type, for when the built-in options are not enough.
Loading

0 comments on commit 02743ec

Please sign in to comment.