CColorRef:Invert


The Invert method complements the color members of the CColorRef object by subtracting from the maximum value of 255. For example, color value 240 becomes value 15 or value 100 becomes value 155.

Syntax

CColorRef:Invert()

Example

The following script complements the color:

 

C = CColorRef:new()

-- create a new CColorRef

C:Set(255,120,0)

-- set orange

C:Invert()

-- invert the color

Printf("%d,%d,%d", C.R,C.G,C.B )

-- result: 0,135,255

Related Topics

ChoosePal

CColorRef class