Package color implements a basic color library.

Static methods

staticinlinebenchmarkNYCbCrAToRGBA(_b:Ref<B>):Void

staticinlinebenchmarkRGBToYCbCr(_b:Ref<B>):Void

staticinlinebenchmarkYCbCrToRGB(_b:Ref<B>):Void

staticinlinebenchmarkYCbCrToRGBA(_b:Ref<B>):Void

staticinlinecMYKToRGB(_c:GoUInt8, _m:GoUInt8, _y:GoUInt8, _k:GoUInt8):{_2:GoUInt8, _1:GoUInt8, _0:GoUInt8}

CMYKToRGB converts a CMYK quadruple to an RGB triple.

staticinlinemodelFunc(_f:Color_ ‑> Color_):Model

ModelFunc returns a Model that invokes f to implement the conversion.

staticinlinerGBToCMYK(_r:GoUInt8, _g:GoUInt8, _b:GoUInt8):{_3:GoUInt8, _2:GoUInt8, _1:GoUInt8, _0:GoUInt8}

RGBToCMYK converts an RGB triple to a CMYK quadruple.

staticinlinerGBToYCbCr(_r:GoUInt8, _g:GoUInt8, _b:GoUInt8):{_2:GoUInt8, _1:GoUInt8, _0:GoUInt8}

RGBToYCbCr converts an RGB triple to a Y'CbCr triple.

staticinlinetestCMYKGray(_t:Ref<T_>):Void

TestCMYKGray tests that CMYK colors are a superset of Gray colors.

staticinlinetestCMYKRoundtrip(_t:Ref<T_>):Void

TestCMYKRoundtrip tests that a subset of RGB space can be converted to CMYK and back to within 1/256 tolerance.

staticinlinetestCMYKToRGBConsistency(_t:Ref<T_>):Void

TestCMYKToRGBConsistency tests that calling the RGBA method (16 bit color) then truncating to 8 bits is equivalent to calling the CMYKToRGB function (8 bit color).

staticinlinetestNYCbCrAAlpha(_t:Ref<T_>):Void

TestNYCbCrAAlpha tests that NYCbCrA colors are a superset of Alpha colors.

staticinlinetestNYCbCrAYCbCr(_t:Ref<T_>):Void

TestNYCbCrAYCbCr tests that NYCbCrA colors are a superset of YCbCr colors.

staticinlinetestPalette(_t:Ref<T_>):Void

staticinlinetestSqDiff(_t:Ref<T_>):Void

staticinlinetestYCbCrGray(_t:Ref<T_>):Void

TestYCbCrGray tests that YCbCr colors are a superset of Gray colors.

staticinlinetestYCbCrRoundtrip(_t:Ref<T_>):Void

TestYCbCrRoundtrip tests that a subset of RGB space can be converted to YCbCr and back to within 2/256 tolerance.

staticinlinetestYCbCrToRGBConsistency(_t:Ref<T_>):Void

TestYCbCrToRGBConsistency tests that calling the RGBA method (16 bit color) then truncating to 8 bits is equivalent to calling the YCbCrToRGB function (8 bit color).

staticinlineyCbCrToRGB(_y:GoUInt8, _cb:GoUInt8, _cr:GoUInt8):{_2:GoUInt8, _1:GoUInt8, _0:GoUInt8}

YCbCrToRGB converts a Y'CbCr triple to an RGB triple.