Skip to content

An Arduino library that will convert a colour temperature to RGB.

License

Notifications You must be signed in to change notification settings

timvw74/Kelvin2RGB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kelvin2RGB

Kelvin2RGB is an Arduino library that will convert a colour temperature to RGB. It accepts a Temperature and a Brightness and calculates the values for RGB corrected for the brightness.

Usage

Include the library and then create an object using the Temperature and Brightness you want to calculate for. You can then extract the values for Red Green and Blue.

Kelvin2RGB kelvin(4100, 75);  //Warm light at 75% brightness
byte red = kelvin.Red;        //191
byte green = kelvin.Green;    //156
byte blue = kelvin.Blue;      //127
Kelvin2RGB kelvin(9500, 50);  //Cool light at 50% brightness
byte red = kelvin.Red;        //102
byte green = kelvin.Green;    //110
byte blue = kelvin.Blue;      //127

About

An Arduino library that will convert a colour temperature to RGB.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages