CColorRef:Get


The Get method returns the red, green, and blue color components as numbers. This is a class version of the StrToRgb function.

Syntax

R, G, B = CColorRef:Get()

where

    R, G, and B are the returned color component values. On failure, 0, 0, 0 is returned.

Example

The following script returns the 3 color components. In this example, C:Get() is the last (or only) argument to Printf, so all 3 returned values can be obtained within the call to Printf:

 

C = CColorRef:new()

-- create a new CColorRef

C:Set(2550,10.2,0.12)

-- set to orange

Printf("Values: %lg,%lg,%lg", C:Get() )

-- result: Values: 2550, 10.2, 0.12

Related Topics

Set

ChoosePal

StrToRgb

CColorRef class