color
A library for representing and manipulating colors
0.3.3
4.3M downloads/mo
#4841 most downloaded on crates.io
linebender/color
What this package is like to depend on
Last release 3 months ago
05 May 2026
Ships unpredictably
gaps range from 1 weeks to 10.0 years
Nearly every release is documented
notes for 10 of 11 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
11 releases · first in 2014
2 releases in the last 12 months
see the full history below
Release timeline
11 releases · Nov 2014 to May 2026Releases
latest 11-
0.3.305 May 2026Release notes
Open source →This release has an MSRV of 1.82.
Changed
-
Skip serializing/deserializing
PhantomDatamarker fields ofOpaqueColor,AlphaColor, andPremulColorwhen theserdefeature is enabled. (#202 by @alvinisspicy)This is technically a breaking change: data serialized with 0.3.2 or earlier will now fail to deserialize.
We expect this to not be an issue in practice; if you do hit this issue, please let us know and we will re-evaluate. -
Oklch::WHITE_COMPONENTS's hue is now 0° instead of 90°. (#210 by @tomcur) -
Mapping functions like
OpaqueColor::mapnow takeFnOnceinstead ofFn. (#211 by @tomcur)
New Contributors
- @alvinisspicy made their first contribution in #202
Full Changelog: v0.3.2...v0.3.3
Release notes
Open source →This release has an [MSRV][] of 1.82.
Changed
-
Skip serializing/deserializing
PhantomDatamarker fields ofOpaqueColor,AlphaColor, andPremulColorwhen theserdefeature is enabled. ([#202][] by [@alvinisspicy][])This is technically a breaking change: data serialized with 0.3.2 or earlier will now fail to deserialize. We expect this to not be an issue in practice; if you do hit this issue, please let us know and we will re-evaluate.
-
Oklch::WHITE_COMPONENTS's hue is now 0° instead of 90°. ([#210][] by [@tomcur][]) -
Mapping functions like
OpaqueColor::mapnow takeFnOnceinstead ofFn. ([#211][] by [@tomcur][])
-
-
0.3.210 Sep 2025Release notes
Open source →This release has an MSRV of 1.82.
Added
-
Add
interpolate_unpremultipliedandgradient_unpremultipliedfor interpolating in unpremultiplied (straight) alpha space.While such interpolation will often give perceptually undesired results, this allows using Color to implement rendering features where such interpolation is specified, like in the HTML Canvas element. (#185 by @sagudev)
Changed
- Specify XYZ-D65 color space conversion matrices as exact rationals. (#171 by @tomcur)
- Improve documentation of
AlphaColorvsPremulColorto clarify alpha premultiplication, and make both types more discoverable from each other. (#190 by @tomcur)
New Contributors
- @ProgramCrafter made their first contribution in #186
- @sagudev made their first contribution in #191
Full Changelog: v0.3.1...v0.3.2
Release notes
Open source →This release has an [MSRV][] of 1.82.
Added
-
Add
interpolate_unpremultipliedandgradient_unpremultipliedfor interpolating in unpremultiplied (straight) alpha space.While such interpolation will often give perceptually undesired results, this allows using Color to implement rendering features where such interpolation is specified, like in the HTML Canvas element. ([#185][] by [@sagudev][])
Changed
- Specify XYZ-D65 color space conversion matrices as exact rationals. ([#171][] by [@tomcur][])
- Improve documentation of
AlphaColorvsPremulColorto clarify alpha premultiplication, and make both types more discoverable from each other. ([#190][] by [@tomcur][])
-
-
0.3.119 May 2025Release notes
Open source →This release has an MSRV of 1.82.
Fixed
- Compilation failure with nightly Rust due to
core_float_mathchanges. (#175 by @ajakubowicz-canva)
New Contributors
- @ajakubowicz-canva made their first contribution in #175
Full Changelog: v0.3.0...v0.3.1
Release notes
Open source →This release has an [MSRV][] of 1.82.
Fixed
- Compilation failure with nightly Rust due to
core_float_mathchanges. ([#175][] by [@ajakubowicz-canva][])
- Compilation failure with nightly Rust due to
-
0.3.030 Apr 2025Release notes
Open source →This release has an MSRV of 1.82.
Added
-
Support converting between color spaces without chromatic adaptation, thereby representing the same absolute color in the destination color space as in the source color space. (#139, #153 by @tomcur)
- Add absolute color conversion matrices for ProPhoto RGB, ACES2065-1 and ACEScg for faster conversion without chromatic adaptation to and from these color spaces. (#156, #164, #165 by @tomcur)
Note to
ColorSpaceimplementers: theWHITE_POINTassociated constant is added toColorSpace, defaulting to D65.
Implementations with a non-D65 white point should set this constant to get correct default absolute conversion behavior. -
Support manual chromatic adaptation of colors between arbitrary white point chromaticities. (#139 by @tomcur)
-
Add
Missing::EMPTYto allow getting an emptyMissingset inconstcontexts. (#149 by @tomcur) -
Add
From<AlphaColor<_>> for DynamicColorconversions for all color spaces that have a direct runtime representation inColorSpaceTag. (#155 by @LaurenzV) -
Add usage examples for
DynamicColor::interpolateandgradient. (#158, #159 by @tomcur)
Changed
- Breaking change: the deprecated conversion
From<Rgba8> for PremulColor<Srgb>has been removed. UseFrom<PremulRgba8> for PremulColor<Srgb>instead. (#157 by @tomcur) - Improve
no_stdsupport. (#146 by @waywardmonkeys) - Make
{AlphaColor, OpaqueColor, PremulColor}::to_rgba8faster. (#166 by @tomcur)
Fixed
- Correctly determine analogous components between ACES2065-1 and other color spaces when converting,
to carry missing components forward when interpolating colors with missing components in the ACES 2065-1 colorspace. (#144 by @tomcur) - Fixed powerless hue component calculation for the HWB color space. (#145 by @tomcur)
Full Changelog: v0.2.3...v0.3.0
Release notes
Open source →This release has an [MSRV][] of 1.82.
Added
-
Support converting between color spaces without chromatic adaptation, thereby representing the same absolute color in the destination color space as in the source color space. ([#139][], [#153][] by [@tomcur][])
- Add absolute color conversion matrices for ProPhoto RGB, ACES2065-1 and ACEScg for faster conversion without chromatic adaptation to and from these color spaces. ([#156][], [#164][], [#165][] by [@tomcur][])
Note to
ColorSpaceimplementers: theWHITE_POINTassociated constant is added toColorSpace, defaulting to D65. Implementations with a non-D65 white point should set this constant to get correct default absolute conversion behavior. -
Support manual chromatic adaptation of colors between arbitrary white point chromaticities. ([#139][] by [@tomcur][])
-
Add
Missing::EMPTYto allow getting an emptyMissingset inconstcontexts. ([#149][] by [@tomcur][]) -
Add
From<AlphaColor<_>> for DynamicColorconversions for all color spaces that have a direct runtime representation inColorSpaceTag. ([#155][] by [@LaurenzV][]) -
Add usage examples for
DynamicColor::interpolateandgradient. ([#158][], [#159][] by [@tomcur][])
Changed
- Breaking change: the deprecated conversion
From<Rgba8> for PremulColor<Srgb>has been removed. UseFrom<PremulRgba8> for PremulColor<Srgb>instead. ([#157][] by [@tomcur][]) - Improve
no_stdsupport. ([#146][] by [@waywardmonkeys][]) - Make
{AlphaColor, OpaqueColor, PremulColor}::to_rgba8faster. ([#166][] by [@tomcur][])
Fixed
- Correctly determine analogous components between ACES2065-1 and other color spaces when converting, to carry missing components forward when interpolating colors with missing components in the ACES 2065-1 colorspace. ([#144][] by [@tomcur][])
- Fixed powerless hue component calculation for the HWB color space. ([#145][] by [@tomcur][])
-
-
0.2.419 May 2025Release notes
Open source →This release has an MSRV of 1.82.
Fixed
- Compilation failure with nightly Rust due to
core_float_mathchanges. (#175 by @ajakubowicz-canva)
New Contributors
- @ajakubowicz-canva made their first contribution in #175
Full Changelog: v0.2.3...v0.2.4
Release notes
Open source →This release has an [MSRV][] of 1.82.
Fixed
- Compilation failure with nightly Rust due to
core_float_mathchanges. ([#175][] by [@ajakubowicz-canva][])
- Compilation failure with nightly Rust due to
-
0.2.320 Jan 2025Release notes
Open source →This release has an MSRV of 1.82.
Added
- Support for the ACES2065-1 color space. (#124 by @tomcur)
- A documentation example implementing
ColorSpace. (#130 by @tomcur) - Conversions of
[u8; 4]and packedu32intoRgba8andPremulRgba8are now provided. (#135 by @tomcur) - Support construction of
AlphaColor<Srgb>,OpaqueColor<Srgb>andPremulColor<Srgb>from rgb8 values. (#136 by @waywardmonkeys)
Fixed
Full Changelog: v0.2.2...v0.2.3
Release notes
Open source →This release has an [MSRV][] of 1.82.
Added
- Support for the ACES2065-1 color space. ([#124][] by [@tomcur][])
- A documentation example implementing
ColorSpace. ([#130][] by [@tomcur][]) - Conversions of
[u8; 4]and packedu32intoRgba8andPremulRgba8are now provided. ([#135][] by [@tomcur][]) - Support construction of
AlphaColor<Srgb>,OpaqueColor<Srgb>andPremulColor<Srgb>from rgb8 values. ([#136][] by [@waywardmonkeys][])
Fixed
- Specify some
ColorSpace::WHITE_COMPONENTSto higher precision. ([#128][], [#129][] by [@tomcur][])
-
0.2.203 Jan 2025Release notes
Open source →This release has an MSRV of 1.82.
Fixed
- Colors in
XyzD65are serialized asxyz-d65rather thanxyz. (#118 by @waywardmonkeys) - Alpha values are clamped at parse time. (#119 by @waywardmonkeys)
Full Changelog: v0.2.1...v0.2.2
Release notes
Open source →This release has an [MSRV][] of 1.82.
Fixed
- Colors in
XyzD65are serialized asxyz-d65rather thanxyz. ([#118][] by [@waywardmonkeys][]) - Alpha values are clamped at parse time. ([#119][] by [@waywardmonkeys][])
- Colors in
-
0.2.128 Dec 2024Release notes
Open source →This release has an MSRV of 1.82.
Added
- Add
FromStrimpl forAlphaColor,DynamicColor,OpaqueColor,PremulColor. (#111 by @waywardmonkeys)
Changed
- Don't enable
serde'sstdfeature when enabling ourstdfeature. (#108 by @waywardmonkeys) From<Rgba8>forPremulColoris deprecated and replaced byFrom<PremulRgba8>. (#113 by @waywardmonkeys)
Fixed
- Make color parsing case insensitive. (#109 by @raphlinus)
Full Changelog: v0.2.0...v0.2.1
Release notes
Open source →This release has an [MSRV][] of 1.82.
Added
- Add
FromStrimpl forAlphaColor,DynamicColor,OpaqueColor,PremulColor. ([#111][] by [@waywardmonkeys][])
Changed
- Don't enable
serde'sstdfeature when enabling ourstdfeature. ([#108][] by [@waywardmonkeys][]) From<Rgba8>forPremulColoris deprecated and replaced byFrom<PremulRgba8>. ([#113][] by [@waywardmonkeys][])
Fixed
- Make color parsing case insensitive. ([#109][] by [@raphlinus][])
- Add
-
0.2.017 Dec 2024Release notes
Open source →This release has an MSRV of 1.82.
Added
- Add
BLACK,WHITE, andTRANSPARENTconstants to the color types. (#64 by @waywardmonkeys) - The
serdefeature enables usingserdewithAlphaColor,DynamicColor,HueDirection,OpaqueColor,PremulColor, andRgba8. (#61, #70, #80 by @waywardmonkeys) - Conversion of a
Rgba8to au32is now provided. (#66, #77 by @waywardmonkeys, #100 by @tomcur) - A new
PremulRgba8type mirrorsRgba8, but forPremulColor. (#66 by @waywardmonkeys) AlphaColor::with_alphaallows setting the alpha channel. (#67 by @waywardmonkeys)- Support for the
ACEScgcolor space. (#54 by @MightyBurger) DynamicColorgetswith_alphaandmultiply_alpha. (#71 by @waywardmonkeys)DynamicColornow implsPartialEq. (#75 by @waywardmonkeys)AlphaColor,OpaqueColor, andPremulColornow implPartialEq. (#76, #86 by @waywardmonkeys)HueDirectionnow implsPartialEq. (#79 by @waywardmonkeys)ColorSpaceTagandHueDirectionnow have bytemuck support. (#81 by @waywardmonkeys)- A
DynamicColorparsed from a named color or named color space function now serializes back to that name, as per the CSS Color Level 4 spec (#39 by @tomcur). CacheKeyto allow using colors as keys for resource caching. (#92 by @DJMcNab)
Changed
- The
mul_alphamethod was renamed tomultiply_alpha. (#65 by @waywardmonkeys)
Fixed
- Stray parenthesis in hex serialization of
Rgba8fixed. (#78 by @raphlinus)
New Contributors
- @MightyBurger made their first contribution in #54
- @nicoburns made their first contribution in #97
Full Changelog: v0.1.0...v0.2.0
Release notes
Open source →This release has an [MSRV][] of 1.82.
Added
- Add
BLACK,WHITE, andTRANSPARENTconstants to the color types. ([#64][] by [@waywardmonkeys][]) - The
serdefeature enables usingserdewithAlphaColor,DynamicColor,HueDirection,OpaqueColor,PremulColor, andRgba8. ([#61][], [#70][], [#80][] by [@waywardmonkeys][]) - Conversion of a
Rgba8to au32is now provided. ([#66][], [#77][] by [@waywardmonkeys][], [#100][] by [@tomcur][]) - A new
PremulRgba8type mirrorsRgba8, but forPremulColor. ([#66][] by [@waywardmonkeys][]) AlphaColor::with_alphaallows setting the alpha channel. ([#67][] by [@waywardmonkeys][])- Support for the
ACEScgcolor space. ([#54][] by [@MightyBurger][]) DynamicColorgetswith_alphaandmultiply_alpha. ([#71][] by [@waywardmonkeys][])DynamicColornow implsPartialEq. ([#75][] by [@waywardmonkeys][])AlphaColor,OpaqueColor, andPremulColornow implPartialEq. ([#76][], [#86][] by [@waywardmonkeys][])HueDirectionnow implsPartialEq. ([#79][] by [@waywardmonkeys][])ColorSpaceTagandHueDirectionnow have bytemuck support. ([#81][] by [@waywardmonkeys][])- A
DynamicColorparsed from a named color or named color space function now serializes back to that name, as per the CSS Color Level 4 spec ([#39][] by [@tomcur][]). CacheKeyto allow using colors as keys for resource caching. ([#92][] by [@DJMcNab][])
Changed
- The
mul_alphamethod was renamed tomultiply_alpha. ([#65][] by [@waywardmonkeys][])
Fixed
- Stray parenthesis in hex serialization of
Rgba8fixed. ([#78][] by [@raphlinus][])
- Add
-
0.1.020 Nov 2024Release notes
Open source →We are proud to announce that we have released v0.1.0 of Color!
The Color library provides functionality for representing, converting, parsing, serializing, and manipulating colors in a variety of color spaces. It closely follows the CSS Color Level 4 draft spec.
-
0.0.121 Nov 2014Nothing published for this version