PaintColorPicker
Classes
Class: PaintColorPicker
Extends Widget
A
PaintColorPickerwidget selects colors using HSL (Hue, Saturation, Luminance) or RGB. Provides a spectrum and luminance widget for visual color selection, along with functions to get and set colors programmatically.Dependencies:
- EmptyWidget used for the
luminanceWidgetandspectrumWidgetfields.
Field: spectrumWidget
EmptyWidget
The widget displaying the color spectrum.
Field: luminanceWidget
EmptyWidget
The widget controlling luminance.
Method: SetSat
(method) PaintColorPicker:SetSat(sat: number)
Sets the saturation value for the PaintColorPicker and does not update the
PaintColorPicker.luminanceWidget.@param
sat— The saturation value. (0to240)
Method: SetLum
(method) PaintColorPicker:SetLum(lum: number)
Sets the luminance value for the PaintColorPicker but does not update the
PaintColorPicker.luminanceWidget.@param
lum— The luminance value. (0to240)
Method: SetSpectrumBg
(method) PaintColorPicker:SetSpectrumBg(bg: Drawablebase)
Sets the background for the spectrum widget of the PaintColorPicker.
@param
bg— The background drawable for the spectrum widget.local spectrumBg = widget:CreateDrawable("ui/login_stage/color_palette.dds", "color_bg", "background") spectrumBg:AddAnchor("TOPLEFT", widget.spectrumWidget, 0, 0) spectrumBg:AddAnchor("BOTTOMRIGHT", widget.spectrumWidget, 0, 0) widget:SetSpectrumBg(spectrumBg)
Method: SetLuminanceBg
(method) PaintColorPicker:SetLuminanceBg(bg: Drawablebase)
Sets the background for the luminance widget of the PaintColorPicker.
@param
bg— The background drawable for the luminance widget.local luminanceBg = widget:CreateDrawable("ui/login_stage/color_palette.dds", "color_bg", "background") luminanceBg:AddAnchor("TOPLEFT", widget.luminanceWidget, 0, 0) luminanceBg:AddAnchor("BOTTOMRIGHT", widget.luminanceWidget, 0, 0) widget:SetLuminanceBg(luminanceBg)
Method: SetHue
(method) PaintColorPicker:SetHue(hue: number)
Sets the hue value for the PaintColorPicker but does not update the
PaintColorPicker.luminanceWidget.@param
hue— The hue value. (0to240)
Method: SetRGBColor
(method) PaintColorPicker:SetRGBColor(red: number, green: number, blue: number)
Sets the RGB color values for the PaintColorPicker and updates the
PaintColorPicker.luminanceWidget.@param
red— The red color component. (0to255)@param
green— The green color component. (0to255)@param
blue— The blue color component. (0to255)
Method: SetHLSColor
(method) PaintColorPicker:SetHLSColor(hue: number, lum: number, sat: number)
Sets the HSL color values for the PaintColorPicker and updates the
PaintColorPicker.luminanceWidget.@param
hue— The hue component. (min:0, max:1)@param
lum— The luminance component. (min:0, max:1)@param
sat— The saturation component. (min:0, max:1)
Method: GetSat
(method) PaintColorPicker:GetSat()
-> saturation: number
Retrieves the saturation value of the PaintColorPicker.
@return
saturation— The saturation value. (min:0, max:1)
Method: GetHue
(method) PaintColorPicker:GetHue()
-> hue: number
Retrieves the hue value of the PaintColorPicker.
@return
hue— The hue value. (min:0, max:1)
Method: GetSpectrumWidget
(method) PaintColorPicker:GetSpectrumWidget()
-> spectrumWidget: EmptyWidget
Retrieves the spectrum widget of the PaintColorPicker (same as
PaintColorPicker.spectrumWidget).@return
spectrumWidget— The spectrum widget.
Method: GetLum
(method) PaintColorPicker:GetLum()
-> luminance: number
Retrieves the luminance value of the PaintColorPicker.
@return
luminance— The luminance value. (min:0, max:1)
Method: GetRGBColor
(method) PaintColorPicker:GetRGBColor()
-> red: number
2. green: number
3. blue: number
Retrieves the RGB color values of the PaintColorPicker.
@return
red— The red color component. (0to255)@return
green— The green color component. (0to255)@return
blue— The blue color component. (0to255)
Method: GetLuminanceWidget
(method) PaintColorPicker:GetLuminanceWidget()
-> luminanceWidget: EmptyWidget
Retrieves the luminance widget of the PaintColorPicker (same as
PaintColorPicker.luminanceWidget).@return
luminanceWidget— The luminance widget.
Method: GetHLSColor
(method) PaintColorPicker:GetHLSColor()
-> hue: number
2. saturation: number
3. luminance: number
Retrieves the HSL color values of the PaintColorPicker.
@return
hue— The hue component. (min:0, max:1)@return
saturation— The saturation component. (min:0, max:1)@return
luminance— The luminance component. (min:0, max:1)