mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
* New function: rgb_to_hsl() * New function: hsl_to_rgb() * Replace XTerm’s hls_to_rgb() with our own, hsl_to_rgb(). * Ensure hue/lum/sat values are within range before calling hsl_to_rgb() Note that sixels’ use the following primary hues: * blue: 0° * red: 120 * green: 240° While “standard” HSL uses: * red: 0° * green: 120° * blue: 240° Thus, we need to adjust the sixel’s hue value before calling hsl_to_rgb().
6 lines
144 B
C
6 lines
144 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
void rgb_to_hsl(uint32_t rgb, int *hue, int *sat, int *lum);
|
|
uint32_t hsl_to_rgb(int hue, int sat, int lum);
|