Skip to content

Commit

Permalink
Merge pull request #407 from Ogeon/chromatic_adaptation
Browse files Browse the repository at this point in the history
Rework chromatic adaptation
  • Loading branch information
Ogeon authored Aug 2, 2024
2 parents 0a69512 + c9c7491 commit 39a9c7a
Show file tree
Hide file tree
Showing 7 changed files with 433 additions and 51 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"rust-analyzer.imports.granularity.enforce": true,
"rust-analyzer.imports.granularity.group": "crate",
"rust-analyzer.imports.group.enable": true,
"rust-analyzer.check.command": "clippy"
"rust-analyzer.check.command": "clippy",
"rust-analyzer.imports.preferNoStd": true
}
4 changes: 0 additions & 4 deletions palette/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ use palette::{
encoding,
white_point,
rgb::Rgb,
chromatic_adaptation::AdaptFrom,
Srgb
};

Expand All @@ -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.
Expand Down
Loading

0 comments on commit 39a9c7a

Please sign in to comment.