Garry's Mod Wiki

DColorCube:GetRGB

Description

An AccessorFunc that returns the color cube's current set color.

Returns

1 table
The set color, uses Color.

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