Skip to content

Commit

Permalink
Derive PartialEq for AlphaColor, OpaqueColor, PremulColor (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Dec 10, 2024
1 parent d866b72 commit 1f8f23f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This release has an [MSRV][] of 1.82.
* Support for the `ACEScg` colorspace. ([#54][] by [@MightyBurger][])
* `DynamicColor` gets `with_alpha` and `multiply_alpha`. ([#71][] by [@waywardmonkeys][])
* `DynamicColor` now impls `Hash` and `PartialEq`. ([#75][] by [@waywardmonkeys][])
* `AlphaColor`, `OpaqueColor`, and `PremulColor` now impl `PartialEq`. ([#76][] by [@waywardmonkeys][])
* `HueDirection` now impls `PartialEq`. ([#79][] by [@waywardmonkeys][])
* `ColorSpaceTag` and `HueDirection` now have bytemuck support. ([#81][] by [@waywardmonkeys][])

Expand Down Expand Up @@ -55,6 +56,7 @@ This is the initial release.
[#70]: https://github.com/linebender/color/pull/70
[#71]: https://github.com/linebender/color/pull/71
[#75]: https://github.com/linebender/color/pull/75
[#76]: https://github.com/linebender/color/pull/76
[#77]: https://github.com/linebender/color/pull/77
[#78]: https://github.com/linebender/color/pull/78
[#79]: https://github.com/linebender/color/pull/79
Expand Down
6 changes: 3 additions & 3 deletions color/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::floatfuncs::FloatFuncs;
/// major motivation for including these is to enable weighted sums, including
/// for spline interpolation. For cylindrical color spaces, hue fixup should
/// be applied before interpolation.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[repr(transparent)]
pub struct OpaqueColor<CS> {
Expand All @@ -38,7 +38,7 @@ pub struct OpaqueColor<CS> {
/// A color in a color space known at compile time, with an alpha channel.
///
/// See [`OpaqueColor`] for a discussion of arithmetic traits and interpolation.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[repr(transparent)]
pub struct AlphaColor<CS> {
Expand All @@ -61,7 +61,7 @@ pub struct AlphaColor<CS> {
/// give undesirable results.
///
/// See [`OpaqueColor`] for a discussion of arithmetic traits and interpolation.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[repr(transparent)]
pub struct PremulColor<CS> {
Expand Down

0 comments on commit 1f8f23f

Please sign in to comment.