Lysa.ui  0.0
Lysa 3D Engine
ColorPicker Class Referenceabstract

Detailed Description

A color selector with a color wheel and one slider per component. Fires OnColorChange.

Inherits from: Widget

Lua full name: lysa.ui.ColorPicker

Public Member Functions

nil set_mode_labels (rgb: string, hsv: string, linear: string)
 Replaces the labels of the three mode tabs, for localization. More...
 
ColorSlider get_slider (component: ColorPickerComponent)
 Returns the gradient slider of a component. More...
 
Text get_label (component: ColorPickerComponent)
 Returns the label of a component. More...
 
SpinBox get_value (component: ColorPickerComponent)
 Returns the spin box of a component. More...
 
nil set_resources (res_preview: string)
 Reloads the visual style of the color preview box. More...
 
number component_of (color: lysa.float4, index: integer)
 Returns the value of the component at the given index of a color. More...
 
number to_linear (value: number)
 Converts a component from the sRGB space to the linear space. More...
 
number from_linear (value: number)
 Converts a component from the linear space to the sRGB space. More...
 

Properties

lysa.float4 color
 The currently selected RGBA color.
 
integer mode
 The color space displayed (see lysa.ui.ColorPickerMode): RGB, HSV or LINEAR.
 
TabBar tab_bar
 The bar of tabs selecting the color space. (read-only)
 
number tab_height
 Height of the bar of tabs.
 
number preview_height
 Height of the color preview box.
 
number wheel_height
 Height of the color wheel row.
 
number brightness_width
 Width of the brightness slider displayed next to the wheel.
 
number row_height
 Height of one component row.
 
number label_width
 Width of the label of a component row.
 
number value_width
 Width of the spin box of a component row.
 
number auto_height
 The height needed to display the whole picker. (read-only)
 
Box preview
 The box displaying the selected color. (read-only)
 
ColorWheel wheel
 The hue/saturation wheel. (read-only)
 
ColorSlider brightness_slider
 The slider setting the brightness of the wheel. (read-only)
 

Member Function Documentation

nil set_mode_labels ( string  rgb,
string  hsv,
string  linear)

Replaces the labels of the three mode tabs, for localization.

Parameters
rgbstring
hsvstring
linearstring
ColorSlider get_slider ( ColorPickerComponent  component)

Returns the gradient slider of a component.

Parameters
componentColorPickerComponent
Returns
ColorSlider
Text get_label ( ColorPickerComponent  component)

Returns the label of a component.

Parameters
componentColorPickerComponent
Returns
Text
SpinBox get_value ( ColorPickerComponent  component)

Returns the spin box of a component.

Parameters
componentColorPickerComponent
Returns
SpinBox
nil set_resources ( string  res_preview)

Reloads the visual style of the color preview box.

Parameters
res_previewstring
number component_of ( lysa.float4  color,
integer  index)

Returns the value of the component at the given index of a color.

Parameters
colorlysa.float4
indexinteger
Returns
number
number to_linear ( number  value)

Converts a component from the sRGB space to the linear space.

Parameters
valuenumber
Returns
number
number from_linear ( number  value)

Converts a component from the linear space to the sRGB space.

Parameters
valuenumber
Returns
number

Property Documentation

lysa.float4 color

The currently selected RGBA color.

integer mode

The color space displayed (see lysa.ui.ColorPickerMode): RGB, HSV or LINEAR.

TabBar tab_bar

The bar of tabs selecting the color space. (read-only)

number tab_height

Height of the bar of tabs.

Widget footer

The optional widget displayed under the component rows. (read-only)

number footer_height

Height of the footer, zero to hide it.

number preview_height

Height of the color preview box.

number wheel_height

Height of the color wheel row.

number brightness_width

Width of the brightness slider displayed next to the wheel.

number row_height

Height of one component row.

number label_width

Width of the label of a component row.

number value_width

Width of the spin box of a component row.

number auto_height

The height needed to display the whole picker. (read-only)

Box preview

The box displaying the selected color. (read-only)

ColorWheel wheel

The hue/saturation wheel. (read-only)

ColorSlider brightness_slider

The slider setting the brightness of the wheel. (read-only)