Skip to content

A JavaScript file that provides functions to convert the CIE (XYZ) color space to the RGB color space and vice versa.

License

Notifications You must be signed in to change notification settings

usolved/cie-rgb-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cie-rgb-converter

Overview

This script provides two functions to convert the CIE (XYZ) color space to the RGB color space and vice versa.

The developer documentation for Philips Hue provides the formulas used in this script: https://developers.meethue.com/documentation/color-conversions-rgb-xy

I've used the formulas and Objective-C example code and transfered it to JavaScript.

Installation

Just include the cie_rgb_converter.js file to your HTML page:

<script src="cie_rgb_converter.js"></script>

Examples

Convert CIE to RGB

var rgb = cie_to_rgb(0.6611, 0.2936)

Convert RGB to CIE

var cie = rgb_to_cie(255, 39, 60)

Authors

Ricardo Klement (www.usolved.net)

About

A JavaScript file that provides functions to convert the CIE (XYZ) color space to the RGB color space and vice versa.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published