Colourful 3.2.0

This package has a SemVer 2.0.0 package version: 3.2.0+build.454.
dotnet add package Colourful --version 3.2.0                
NuGet\Install-Package Colourful -Version 3.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Colourful" Version="3.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Colourful --version 3.2.0                
#r "nuget: Colourful, 3.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Colourful as a Cake Addin
#addin nuget:?package=Colourful&version=3.2.0

// Install Colourful as a Cake Tool
#tool nuget:?package=Colourful&version=3.2.0                

Colourful logo Colourful .NET

Build status Tests codecov NuGet version NuGet downloads API documentation

Open source .NET library for working with color spaces.

The library is written in C# and released with an MIT license, so feel free to fork or use commercially.

Any feedback is appreciated, please visit the issues page or send me an e-mail.

Download

Binaries of the last build can be downloaded on the AppVeyor CI page of the project.

The library is also published on NuGet.org, install using:

PM> Install-Package Colourful

Colourful is CLS Compliant (to allow use in VB.NET etc.) and is built for these target frameworks:

  • .NET 6 or newer
  • .NET Framework 4.5
  • .NET Standard 2.0
  • .NET Standard 1.1
  • For older .NET Framework 4.0 see version 1 of the library.

Usage

Example "hello world" usage that converts a color from sRGB to XYZ (keeping the D65 white point):

IColorConverter<RGBColor, XYZColor> converter = new ConverterBuilder()
    .FromRGB(RGBWorkingSpaces.sRGB)
    .ToXYZ(Illuminants.D65)
    .Build();

RGBColor rgbColor = new RGBColor(1, 0, 0.5);
XYZColor xyzColor = converter.Convert(rgbColor); // XYZ [X=0.45, Y=0.23, Z=0.22]

Documentation

Please see the docs pages below for various topics:

  • Conversion between color spaces
    • also handles chromatic adaptation with multiple possible LMS transformation matrices:
      • Bradford (default)
      • Von Kries (Hunt-Pointer-Estevez adjusted for D65)
      • Von Kries (Hunt-Pointer-Estevez for equal energy)
      • XYZ scaling
      • Spectral-sharpened Bradford
      • CMCCAT2000
      • CAT02
      • (user-defined chromatic adaptation matrix)
  • Correlated color temperature (CCT)
    • Planckian locus approximation method
  • Ranges of channel values and clamping
  • Computing color difference
    • multiple algorithms supported:
      • CIE Delta-E 1976
      • CMC l:c (1984)
      • CIE Delta-E 1994
      • CIE Delta-E 2000
      • J<sub>z</sub>C<sub>z</sub>h<sub>z</sub> Delta-E<sub>z</sub>
      • Euclidean distance
  • Cylindrical color spaces
  • Illuminants and white points
    • white points are handled correctly throughout the conversions
    • multiple illuminant are built-in:
      • A (Incandescent / Tungsten)
      • B (Direct sunlight at noon (obsolete))
      • C (Average / North sky Daylight (obsolete))
      • D50 (Horizon Light. ICC profile PCS)
      • D55 (Mid-morning / Mid-afternoon Daylight)
      • D65 (Noon Daylight: Television, sRGB color space)
      • D75 (North sky Daylight)
      • E (Equal energy)
      • F2 (Cool White Fluorescent)
      • F7 (D65 simulator, Daylight simulator)
      • F11 (Philips TL84, Ultralume 40)
      • (user-defined white points)
  • Macbeth ColorChecker chart
  • Changes between v2 and v3

For information about specific color spaces, see the following docs pages:

  • RGB color spaces
    • support for both ordinary RGB and linear RGB
    • multiple working spaces supported:
      • sRGB
      • Simplified sRGB
      • ECI RGB v2
      • Adobe RGB (1998)
      • Apple sRGB
      • Best RGB
      • Beta RGB
      • Bruce RGB
      • CIE RGB
      • ColorMatch RGB
      • Don RGB 4
      • Ekta Space PS5
      • NTSC RGB
      • PAL/SECAM RGB
      • ProPhoto RGB
      • SMPTE-C RGB
      • Wide Gamut RGB
      • Rec. 709 (ITU-R Recommendation BT.709 – HDTV)
      • Rec. 2020 (ITU-R Recommendation BT.2020 – UHDTV)
      • (user-defined RGB working spaces)
  • Lab color spaces
    • CIE L*a*b* (1976) (CIELAB)
    • CIE L*C*h°<sub>ab</sub> (CIELCH)
    • Hunter Lab
  • Luv color spaces
    • CIE L*u*v* (1976) (CIELUV)
    • CIE L*C*h°<sub>uv</sub> (CIELCH)
  • XYZ color space
    • CIE XYZ (1931)
    • CIE xyY (derived from XYZ)
  • J<sub>z</sub>a<sub>z</sub>b<sub>z</sub> color spaces
    • J<sub>z</sub>a<sub>z</sub>b<sub>z</sub> (Safdar & al., 2017)
    • J<sub>z</sub>C<sub>z</sub>h<sub>z</sub> (polar of J<sub>z</sub>a<sub>z</sub>b<sub>z</sub>)
  • LMS color space
  • xy chromaticity
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.1 is compatible.  netstandard1.2 was computed.  netstandard1.3 was computed.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Windows Phone wpa81 was computed. 
Windows Store netcore was computed.  netcore45 was computed.  netcore451 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5

    • No dependencies.
  • .NETStandard 1.1

  • .NETStandard 2.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Colourful:

Package Downloads
ClosestColor

Different methods to compare colors to a set of colours, and return the closest color

DevBase.Avalonia.Extension

A high performance image color extractor based on image clusterization

CieViewer

Package Description

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on Colourful:

Repository Stars
SixLabors/ImageSharp
:camera: A modern, cross-platform, 2D Graphics library for .NET
tryashtar/image-map
Converts image to maps for Minecraft Java and Bedrock
DelvUI/DelvUI
DelvUI is a Dalamud plugin for Final Fantasy XIV that provides a fully customizable replacement for the default UI.
KirillOsenkov/QuickInfo
http://quickinfo.io - a search textbox with extensible "answers" (calculator, unit-converter, colors, ascii/unicode, etc). See demo at http://quickinfo.io/?demo
Version Downloads Last updated
3.2.0 13,407 12/10/2023
3.1.0 19,748 12/22/2021
3.0.0 23,382 7/6/2021
3.0.0-beta3 185 5/23/2021
3.0.0-beta2 279 1/2/2021
3.0.0-beta1 269 6/28/2020
3.0.0-alpha1 227 5/15/2020
2.0.5 29,039 3/28/2020
2.0.5-alpha7 455 3/28/2020
2.0.5-alpha6 464 3/28/2020
2.0.5-alpha5 2,826 3/9/2020
2.0.5-alpha4 405 3/9/2020
2.0.5-alpha3 370 3/9/2020
2.0.5-alpha2 402 3/9/2020
2.0.5-alpha 408 3/9/2020
2.0.4 686 3/4/2020
2.0.3 6,213 5/11/2019
2.0.2 9,947 12/15/2018
2.0.1 917 12/12/2018
2.0.0 8,659 7/7/2018
1.2.2 4,300 3/3/2018
1.2.1 2,027 11/18/2017
1.2.0 1,391 11/7/2017
1.1.2 8,583 10/29/2016
1.1.1 2,105 9/19/2016
1.1.0 1,948 6/18/2015
1.0.0 2,179 11/5/2014
1.0.0-alpha2 1,350 8/10/2014
1.0.0-alpha 1,367 5/31/2014