View source

abstract thx.color.Hsv(Array<Float>)

Available on all platforms

HSV (hue-saturation-value) is one of the most common cylindrical-coordinate representations of points in an RGB color model. Developed in the 1970s for computer graphics applications, HSL is used today in color pickers, in image editing software, and less commonly in image analysis and computer vision.

The representation rearranges the geometry of RGB in an attempt to be more intuitive and perceptually relevant than the cartesian (cube) representation, by mapping the values into a cylinder loosely inspired by a traditional color wheel. The angle around the central vertical axis corresponds to "hue" and the distance from the axis corresponds to "saturation". These first two values give the two schemes the 'H' and 'S' in its name. The height corresponds to a third value, the system's representation of the perceived luminance in relation to the saturation.

Class Fields

inline function create(hue:Float, saturation:Float, value:Float):Hsv

function fromFloats(arr:Array<Float>):Hsv

function fromString(color:String):Null<Hsv>

Instance Fields

var hue(get,null):Float

var saturation(get,null):Float

var value(get,null):Float

function analogous(spread:Float = 30.0):Tuple2<Hsv, Hsv>

function complement():Hsv

function equals(other:Hsv):Bool

function interpolate(other:Hsv, t:Float):Hsv

function interpolateWidest(other:Hsv, t:Float):Hsv

function max(other:Hsv):Hsv

function min(other:Hsv):Hsv

function nearEquals(other:Hsv, tolerance:Float = Floats.EPSILON):Bool

function normalize():Hsv

function rotate(angle:Float):Hsv

function roundTo(decimals:Int):Hsv

function split(spread:Float = 144.0):Tuple2<Hsv, Hsv>

function square():Tuple4<Hsv, Hsv, Hsv, Hsv>

function tetrad(angle:Float):Tuple4<Hsv, Hsv, Hsv, Hsv>

function toCmy():Cmy

function toCmyk():Cmyk

function toGrey():Grey

function toHsl():Hsl

function toHsva():Hsva

function toLCh():LCh

function toLab():Lab

function toLuv():Luv

function toRgb():Rgb

function toRgba():Rgba

function toRgbx():Rgbx

function toRgbxa():Rgbxa

function toString():String

function toXyz():Xyz

function toYuv():Yuv

function toYxy():Yxy

function triad():Tuple3<Hsv, Hsv, Hsv>

function withAlpha(alpha:Float):Hsva

function withHue(newhue:Float):Hsv

function withSaturation(newsaturation:Float):Hsv

function withValue(newvalue:Float):Hsv