Skip to content

uncommoncode/color_cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Color

TravisCI Build Status

This C++11 library provides a self-contained colorspace conversion and interpolation library for common color formats useful in artistic and visualization settings.

The currently supported colorspaces include:

  • sRGB
  • RGB 888 (such as "hex" 0xffffff)
  • HSV
  • HSL
  • CIE-XYZ
  • L*a*b*

Example

There are conversion helpers to allow converting from one space to another. For example, converting a hex color from 0xd7f310 to HSV and printing the output:

#include <iostream>

#include <color/transformation.hpp>

int main() {
	color::sRgb srgb(color::to_srgb(0xd7f310));
	color::Hsv hsv(color::to_hsv(srgb));
	
	std::cout << hsv.hue << ", " << hsv.saturation << ", " << hsv.value << std::endl;
	
	return 0;
}

About

Color space conversion and interpolation in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published