haiku/headers/private/shared/HSL.h
Augustin Cavalier 979a0bc487 Appearance: Hide most colors by default and compute them automatically.
In the new "automatic" mode, the number of displayed colors
is just 3, as opposed to the full 38. Much more manageable!

The HSL routines added in this commit were derived from
https://gist.github.com/ciembor/1494530 which is itself derived
from the Wikipedia page describing HSL/HSV.

Part of #15543 and #11636.

Change-Id: I230a358d18c379fb0673162e0b3cbdb8d1b8d84e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7479
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-04-11 17:38:45 +00:00

24 lines
408 B
C++

/*
* Copyright 2024, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _HSL_H
#define _HSL_H
#include <GraphicsDefs.h>
typedef struct hsl_color {
float hue, saturation, lightness;
static hsl_color from_rgb(const rgb_color& rgb);
rgb_color to_rgb() const;
private:
static float hue_to_rgb(float p, float q, float t);
} hsl_color;
#endif // _HSL_H