DColorCube/GetRGB

From Garry's Mod
Jump to: navigation, search
 DColorCube:GetRGB( )

Contents

DescriptionPanelFunc

Returns the color cube's current set color.

Returns

table

The set color, uses Color structure.

Examples

Example

Creates a color cube, sets the color to cyan, adjusts the saturation and value to 50% each, and prints out the final color.

local color_cube = vgui.Create("DColorCube")
color_cube:SetSize(200, 200)
color_cube:Center()

-- Set color to cyan
color_cube:SetColor(Color(0, 255, 255))

-- 50% saturated, 50% valued
color_cube:TranslateValues(0.5, 0.5)

-- Print set color
PrintTable(color_cube:GetRGB())

Output:

r	=	63
b	=	127
a	=	255
g	=	127
Personal tools
Navigation