Garry's Mod Wiki

DColorCube:GetRGB

table DColorCube:GetRGB()

Description

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

Page Links


Special Pages


Wikis

?

Render Time: 35ms

DB GetPage 4
Generate Html 4
SaveChanges (1) 11
Render Body 0
Render Sidebar 14