My Color Conversion library, Colorspace, now available on NuGet - RGB, HSL, HSV, CMYK, XYZ, LAB  
Sunday, July 8, 2012 at 10:18AM
saveenr

This is a library I've been working on for a year – originally to help provide better automatic generation of colors for charts and reports. I found it was useful in several other projects so I've made it available as a NuGet package called Colorspace. It supports an number of conversions as shown below.

Snap000089

NuGet package: http://nuget.org/packages/Colorspace

Documentation: http://sdrv.ms/M7AE9g

EXAMPLE: RGB TO HSL

var a = new ColorRGB32Bit(255,0,0);
var b = new ColorRGB( a );
var c = new ColorHSL( b );

EXAMPLE: RGB TO LAB AND BACK

 

var workingspace = new Colorspace.RGBWorkingSpaces();
var a = new ColorRGB32Bit(255, 0, 0);
var b = new ColorRGB( a );
var c = new ColorXYZ(b, workingspace.SRGB_D65_Degree2);
var d = new ColorLAB(c, workingspace.SRGB_D65_Degree2);
var e = new ColorXYZ(d, workingspace.SRGB_D65_Degree2);
var f = new ColorRGB(e, workingspace.SRGB_D65_Degree2);
var g = new ColorRGB32Bit(f);
Article originally appeared on viziblr (http://viziblr.com/).
See website for complete article licensing information.