Crates.io | tempergb |
lib.rs | tempergb |
version | 0.1.2 |
source | src |
created_at | 2022-06-27 10:34:37.805646 |
updated_at | 2022-06-27 10:51:39.28446 |
description | Convert a color temperature to RGB values |
homepage | |
repository | https://github.com/m-lima/tempergb |
max_upload_size | |
id | 614053 |
size | 9,483 |
Convert a color temperature into RGB
This is a rust port of the work by Tanner Helland
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);