From 9a3a787522da98820c86a5e2370b2948b40510fe Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 26 Feb 2016 19:44:27 -0800 Subject: [PATCH] Created HslColor object API (markdown) --- HslColor-object-API.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 HslColor-object-API.md diff --git a/HslColor-object-API.md b/HslColor-object-API.md new file mode 100644 index 0000000..fbf86bc --- /dev/null +++ b/HslColor-object-API.md @@ -0,0 +1,34 @@ +HslColor represents a color object that is represented by Hue, Saturation, Lightness component values. The primary use of this class is for easy definitions of color. + +## Properties +There are three properties that represent the component values Hue, Saturation, and Lightness. The values range from 0.0f to 1.0f. +H is the primary color component and represents a color wheel. Often you will see examples of this being between 0 and 360, but this library it is between 0.0f and 1.0f inclusive. +L should be generally limited to between (0.0 - 0.5) +``` +float H; +float S; +float L; +``` +## Constructors + +### HslColor(float h, float s, float l) : +Constructs a HslColor using Hue, Saturation, and Lightness color component values. + +### HslColor(RgbColor color); +Construct a HslColor using RgbColor, converting the Rgb to Hsl + +### HslColor() +Construct a HslColor that will have its values set in latter operations. +CAUTION: The H,S,L members are not initialized and may not be consistent until set. + +## Methods +### static HslColor LinearBlend(HslColor left, HslColor right, float progress); +This will blend between two colors by the amount defined by the progress variable. +left - the color to start the blend at. +right - the color to end the blend at. +progress - (0.0f - 1.0f) value where 0.0f will return left and 1.0f will return right and a value between will blend the color weighted linearly between them. +This is a static function, which means you need to call it scoped to the object class and not an instance like... +``` + HslColor results = HslColor::LinearBlend(HslColor(0.88f,1.0f,0.5f), HslColor(0.12f,1.0f,0.5f), 0.33f); +``` +