DColorCube:UpdateColor
Description
This is used internally - although you're able to use it you probably shouldn't.
Updates the color cube RGB based on the given x and y position. Similar to DColorCube:TranslateValues.
Arguments
Example
Creates a yellow color cube and updates/prints out the color at the (0.1, 0.6) position.
local color_cube = vgui.Create("DColorCube")
color_cube:SetSize(200, 200)
color_cube:Center()
-- Set base color to yellow
color_cube:SetColor(Color(255, 255, 0))
-- 10% less saturation, 60% darker
color_cube:UpdateColor(0.1, 0.6)
-- Get new color
local new_color = color_cube:GetRGB()
-- Print new color
print("Color( "..new_color.r..", "..new_color.g..", "..new_color.b..", "..new_color.a.." )")
Output:
Color( 102, 102, 10, 255 )