Class ColorPicker
Custom MonoBehaviour for the ColorPicker
Inheritance
System.Object
ColorPicker
Namespace: Jotunn.GUI
Assembly: Jotunn.dll
Syntax
public class ColorPicker : MonoBehaviour
Fields
| Improve this Doc View SourceaComponent
Component ref
Declaration
public Slider aComponent
Field Value
| Type | Description |
|---|---|
| Slider |
bComponent
Component ref
Declaration
public Slider bComponent
Field Value
| Type | Description |
|---|---|
| Slider |
colorComponent
Component ref
Declaration
public RawImage colorComponent
Field Value
| Type | Description |
|---|---|
| RawImage |
done
Declaration
public static bool done
Field Value
| Type | Description |
|---|---|
| System.Boolean | True when the ColorPicker is closed |
gComponent
Component ref
Declaration
public Slider gComponent
Field Value
| Type | Description |
|---|---|
| Slider |
hexaComponent
Component ref
Declaration
public InputField hexaComponent
Field Value
| Type | Description |
|---|---|
| InputField |
mainComponent
Component ref
Declaration
public Slider mainComponent
Field Value
| Type | Description |
|---|---|
| Slider |
positionIndicator
Component ref
Declaration
public RectTransform positionIndicator
Field Value
| Type | Description |
|---|---|
| RectTransform |
rComponent
Component ref
Declaration
public Slider rComponent
Field Value
| Type | Description |
|---|---|
| Slider |
Methods
| Improve this Doc View SourceCancel()
Manually cancel the ColorPicker and recover the default value
Declaration
public static void Cancel()
CCancel()
Cancel button call
Declaration
public void CCancel()
CDone()
Done button call
Declaration
public void CDone()
Create(Color, String, ColorPicker.ColorEvent, ColorPicker.ColorEvent, Boolean)
Creates a new Colorpicker
Declaration
public static bool Create(Color original, string message, ColorPicker.ColorEvent onColorChanged, ColorPicker.ColorEvent onColorSelected, bool useAlpha = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | original | Color before editing |
| System.String | message | Display message |
| ColorPicker.ColorEvent | onColorChanged | Event that gets called when the color gets modified |
| ColorPicker.ColorEvent | onColorSelected | Event that gets called when one of the buttons done or cancel get pressed |
| System.Boolean | useAlpha | When set to false the colors used don't have an alpha channel |
Returns
| Type | Description |
|---|---|
| System.Boolean | False if the instance is already running |
Done()
Manually close the ColorPicker and apply the selected color
Declaration
public static void Done()
SetA(Single)
Gets a Slider value
Declaration
public void SetA(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | value |
SetA(String)
Gets a InputField value
Declaration
public void SetA(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value |
SetB(Single)
Gets b Slider value
Declaration
public void SetB(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | value |
SetB(String)
Gets b InputField value
Declaration
public void SetB(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value |
SetChooser()
Used by EventTrigger to calculate the chosen value in color box
Declaration
public void SetChooser()
SetG(Single)
Gets g Slider value
Declaration
public void SetG(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | value |
SetG(String)
Gets g InputField value
Declaration
public void SetG(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value |
SetHexa(String)
Gets hexa InputField value
Declaration
public void SetHexa(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value |
SetMain(Single)
Gets main Slider value
Declaration
public void SetMain(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | value |
SetR(Single)
Gets r Slider value
Declaration
public void SetR(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | value |
SetR(String)
Gets r InputField value
Declaration
public void SetR(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value |