Skip to content

Releases: abjerner/Skybrud.Colors

v1.1.1

06 Mar 17:12
Compare
Choose a tag to compare

Installation

Via NuGet:

.NET CLI:

dotnet add package Skybrud.Colors --version 1.1.1

NuGet Package Manager:

Install-Package Skybrud.Colors -Version 1.1.1

Changelog

  • Fixed issues with HEX parsing in parts of the package (see #5, #6 and 7de2a85)
    The ColorUtils.HexToRgb method would fail to parse HEX codes with upper case characters. Thanks to a PR from @hfloyd this has now been fixed.

v1.1.0

26 Sep 19:26
Compare
Choose a tag to compare

New major minor release.

Installation

Via NuGet:

.NET CLI:

dotnet add package Skybrud.Colors --version 1.1.0

NuGet Package Manager:

Install-Package Skybrud.Colors -Version 1.1.0

Changelog

  • Added support for nullable reference types

  • Added better parsing logic

  • Added logic for additional color operations

Skybrud.Colors v1.0.3

16 Dec 22:58
Compare
Choose a tag to compare

Installation

Changelog

  • Added more conversion logic to the ColorUtils class (see 9031c57, fd4fde5, f0086b0)
    This adds more logic for converting back and forth between the supported color models.

  • Added support for the HSV color model (see 0f86d11)
    This release adds support for the HSV color model, which works in a similar way to HSL, but differs with the Value component opposed to the Lightness component of HSL.

  • Introduced new extension methods for various color operations (see 45855cb)
    The ColorExtensions class now contains Saturate, Desaturate, Darken, Lighten, Invert and Grayscale extension methods for doing operations on IColor instances.

  • Introduced new ColorUtils.HexToRgb utility methods (see #2, c1c558f, 7d41437)
    The methods either allow converting a HEX string value into an instance of RgbColor or into corresponding red, green and blue components - thanks to a PR from @hfloyd.

  • Copied logic from ColorHelpers class into the ColorUtils class, and marked the ColorHelpers class as obsolete (see #3, 7d41437 and 09cf9db)
    Being a class with static utility methods, the class should be called ColorUtils instead of ColorHelpers to matching the name in our other packages. The ColorHelpers class is still kept for backwards compatibility, but now marked as obsolete.

  • Introduced new WcagUtils to replace the WcagHelpes class (see 6a4c321)
    Being a class with static utility methods, the class should be called WcagUtils instead of WcagHelpes to matching the name in our other packages. The WcagHelpes class is still kept for backwards compatibility, but now marked as obsolete.

  • Introduced ColorUtils.Clamp methods (see ad52a29 and 240c528)
    The Clamp methods are used internally throughout the package to ensure specified values are within the allowed ranges. Eg. for the RGB color model, the red, green and blue components range from 0 to 255. If a value lower than 0 is specified, the value is "clamped" to 0, and if a value higher than 255 is specified, the value is clamped to 255 - essentially a combination of the Math.Min and Math.Max methods..

  • Introduced new ColorExtensions.Spin extension method (see a2534be)
    When using the HSL color model, the hue component is specified as an angle on a circle, and the Spin method can be used to increate or decrease the angle to get a different color, but with the same saturation and lightness values.

  • Added support for alpha values (see 4a0260a and 9720a8b)
    With this release, the IColor and the different color models now support an alpha component indicating the transparency of the color, The value ranges from 0 (fully transparent) to 1 (fully opaque).

  • Introduced new HexFormat enum class and ToHex method overload to support both RGB and RGBA (see 9720a8b)
    By default the parameterless ToHex method returns a HEX value in the format of #RRGGBB for fully opaque colors, and in the format of #RRGGBBAA for non-opaque colors, which calling the new overload with HexFormat.Auto. If either of the two formats is always preferred, HexFormat.Rgb can be used to force the format to be #RRGGBB, and HexFormat.Rgba can be used to force the format to be #RRGGBBAA.

  • Introduced new ColorUtils.GetGradientColors and ColorUtils.GetGradientColorsAsHex methods (see #4, f8b613d, 435e7df, 3cac602 and 1f259f3)
    Thanks to another PR from @hfloyd, the ColorUtils.GetGradientColors method allows generating a collection of IColor instances representing a gradient starting from startColor to endColor. The GetGradientColorsAsHex allows doing the same, but with HEX string values as both input and output.

  • Added support for HEX alpha values to the ColorUtils.TryParse method (see d9ad869)
    As part of adding alpha level support, the ColorUtils.TryParse method now also supports the #RRGGBBAA format.

  • Introduced new ToCmy, ToCmyk, ToHsl, ToHsv and ToRgb extension methods for converting a collection of IColor to a specific color model (see dd2a753)
    The new extension methods allows converting multiple colors to a given color model. Eg. the ToRgb extension method converts a collection of IColor into a corresponding collection of RgbColor.

Skybrud.Colors v1.0.2

09 Jun 22:49
Compare
Choose a tag to compare

Installation

Changelog

  • Added support for multiple target frameworks so the package now supports both .NET Standard and .NET Framework.

Skybrud.Colors v1.0.1

04 Jan 10:49
Compare
Choose a tag to compare

Changelog

  • Added logic for parsing HEX colors (see 25070fc).

Skybrud.Colors v1.0.0

20 Oct 21:50
Compare
Choose a tag to compare