DColorCube
Description
The DColorCube allows a user to select saturation and value but not hue. Uses HSV colors
Parent
Derives methods, etc not listed on this page from DSlider.
Implements
Implements or overrides the following hooks/methods. If you want to override these, you probably want to call the original function too.
Events
DColorCube:OnUserChanged( table color )
Function which is called when the color cube slider is moved (through user input). Meant to be overridden.
Methods
table DColorCube:GetBaseRGB()
Returns the base Color set by DColorCube:SetBaseRGB.
We advise against using this. It may be changed or removed in a future update.
Returns the value set by DColorCube:SetHue.
DColorCube:SetBaseRGB( table color )
Sets the base color and the color used to draw the color cube panel itself.
Calling this when using a color that isn't 100% saturated and valued (HSVToColor with saturation and value set to 1) causes the color cube to look inaccurate compared to the color that's returned by methods like DColorCube:GetRGB and DColorCube:OnUserChanged. You should use DColorCube:SetColor instead
Sets the base color of the color cube and updates the slider position.
We advise against using this. It may be changed or removed in a future update.
Appears to do nothing and unused.
This is used internally - although you're able to use it you probably shouldn't.
Used internally to set the real "output" color of the panel.
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 and returns its arguments. Similar to DColorCube:UpdateColor.
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.
Example
Creates a DColorCube in a DFrame.
Example
Creates a color cube that's hue is controlled by a DRGBPicker, which outputs the color to the background panel, label, and your copy/paste buffer.
Output: