View source

abstract thx.color.Rgb(Int) from Int to Int

Available on all platforms

The RGB color model is an additive color model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three additive primary colors, red, green, and blue.

The main purpose of the RGB color model is for the sensing, representation, and display of images in electronic systems, such as televisions and computers, though it has also been used in conventional photography. Before the electronic age, the RGB color model already had a solid theory behind it, based in human perception of colors.

RGB is a device-dependent color model: different devices detect or reproduce a given RGB value differently, since the color elements (such as phosphors or dyes) and their response to the individual R, G, and B levels vary from manufacturer to manufacturer, or even in the same device over time. Thus an RGB value does not define the same color across devices without some kind of color management.

Rgb uses an Int as the underlying type.

Class Fields

inline function create(red:Int, green:Int, blue:Int):Rgb

inline function createf(red:Float, green:Float, blue:Float):Rgb

function fromInts(arr:Array<Int>):Rgb

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

Instance Fields

var blue(get,null):Int

var green(get,null):Int

var red(get,null):Int

inline function new(rgb:Int):Rgb

function darker(t:Float):Rgb

function equals(other:Rgb):Bool

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

function lighter(t:Float):Rgb

function max(other:Rgb):Rgb

function min(other:Rgb):Rgb

function toCmy():Cmy

function toCmyk():Cmyk

function toCss3():String

function toGrey():Grey

function toHex(prefix:String = "#"):String

function toHsl():Hsl

function toHsv():Hsv

function toLCh():LCh

function toLab():Lab

function toLuv():Luv

function toRgba():Rgba

function toRgbx():Rgbx

function toRgbxa():Rgbxa

function toString():String

function toXyz():Xyz

function toYuv():Yuv

function toYxy():Yxy

function withAlpha(alpha:Int):Rgba

function withAlphaf(newalpha:Float):Rgba

function withBlue(newblue:Int):Rgb

function withGreen(newgreen:Int):Rgb

function withRed(newred:Int):Rgb