LuaSTG-x Core API
lstg::Color Class Reference

Public Member Functions

function ARGB ()
 
function clone ()
 
function deltaE (local other)
 
function format (local fmt)
 
function fromHSI (local h, local s, local i)
 
function fromHSL (local h, local s, local l)
 
function fromHSV (local h, local s, local v)
 
function fromYUV (local y, local cb, local cr)
 
function gray ()
 
function parse (local s)
 
function reverse (local rev_alpha)
 
function set (local r, local g, local b, local a)
 
function setFloat (local r, local g, local b, local a)
 
function setHue (local h)
 
function setLightness (local l)
 
function setSaturation (local s)
 
function toHSI ()
 
function toHSL ()
 
function toHSV ()
 
function toLAB ()
 
function toTable ()
 
function toXYZ ()
 
function toYUV ()
 
function unpack ()
 
function unpackFloat ()
 

Public Attributes

number a
 
number argb
 
number b
 
number g
 
number r
 

Detailed Description

颜色类 有如下元方法: __eq | __add | __sub | __mul | __tostring

Member Function Documentation

◆ ARGB()

function ARGB ( )

返回颜色的a,r,g,b分量

Returns
number,number,number,number

◆ clone()

function clone ( )

returns a copy

Returns
lstg.Color

◆ deltaE()

function deltaE ( local  other)

◆ format()

function format ( local  fmt)

◆ fromHSI()

function fromHSI ( local  h,
local  s,
local  i 
)

◆ fromHSL()

function fromHSL ( local  h,
local  s,
local  l 
)

◆ fromHSV()

function fromHSV ( local  h,
local  s,
local  v 
)

◆ fromYUV()

function fromYUV ( local  y,
local  cb,
local  cr 
)

◆ gray()

function gray ( )

◆ parse()

function parse ( local  s)

◆ reverse()

function reverse ( local  rev_alpha)

◆ set()

function set ( local  r,
local  g,
local  b,
local  a 
)

sets r,g,b,a (0-255)

Parameters
rnumber
gnumber
bnumber
anumber @optional
Returns
lstg.Color

◆ setFloat()

function setFloat ( local  r,
local  g,
local  b,
local  a 
)

sets r,g,b,a (0-1)

Parameters
rnumber
gnumber
bnumber
anumber @optional
Returns
lstg.Color

◆ setHue()

function setHue ( local  h)

◆ setLightness()

function setLightness ( local  l)

◆ setSaturation()

function setSaturation ( local  s)

◆ toHSI()

function toHSI ( )
Returns
number,number,number

◆ toHSL()

function toHSL ( )
Returns
number,number,number

◆ toHSV()

function toHSV ( )
Returns
number,number,number

◆ toLAB()

function toLAB ( )

Gamma=2.2, sRGB, white point D65

Returns
number,number,number

◆ toTable()

function toTable ( )

◆ toXYZ()

function toXYZ ( )

Convert RGB to CIEXYZ.

Gamma=2.2, sRGB

Returns
number,number,number

◆ toYUV()

function toYUV ( )
Returns
number,number,number

◆ unpack()

function unpack ( )

returns r,g,b,a (0-255)

Returns
number,number,number,number

◆ unpackFloat()

function unpackFloat ( )

returns r,g,b,a (0-1)

Returns
number,number,number,number

Member Data Documentation

◆ a

number a

◆ argb

number argb

◆ b

number b

◆ g

number g

◆ r

number r

The documentation for this class was generated from the following file: