#color #temperature #rbg

tempergb

Convert a color temperature to RGB values

3 releases

0.1.2 Jun 27, 2022
0.1.1 Jun 27, 2022
0.1.0 Jun 27, 2022

#1523 in Algorithms

MIT license

7KB
130 lines

tempergb

Github MIT licensed Cargo Documentation

Convert a color temperature into RGB

This is a rust port of the work by Tanner Helland

Example

use tempergb::{rgb_from_temperature, Color};
let temperature = 2500;
let rgb = tempergb::rgb_from_temperature(temperature);
assert_eq!(rgb, (255, 159, 70));
assert_eq!(rgb.r(), 255);
assert_eq!(rgb.g(), 159);
assert_eq!(rgb.b(), 70);

lib.rs:

Convert a color temperature into RGB

This is a rust port of the work by Tanner Helland

Example

use tempergb::{rgb_from_temperature, Color};
let temperature = 2500;
let rgb = tempergb::rgb_from_temperature(temperature);
assert_eq!(rgb, (255, 159, 70));
assert_eq!(rgb.r(), 255);
assert_eq!(rgb.g(), 159);
assert_eq!(rgb.b(), 70);

No runtime deps