Class ColorwheelModule
Inherited Members
Namespace: NoXP.RuntimeComponents.ColorPicker
Assembly: NoXP.RuntimeComponents.dll
Syntax
public class ColorwheelModule : ColorPickerModuleBase
Constructors
ColorwheelModule(ColorPicker)
Declaration
protected ColorwheelModule(ColorPicker owner)
Parameters
| Type | Name | Description |
|---|---|---|
| ColorPicker | owner |
Methods
Init()
Declaration
protected override void Init()
Overrides
SetHueAngle(Single)
sets the colorwheel module's hue value to update the colorwheel dial position on the colorheel
Declaration
public void SetHueAngle(float hueAngle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | hueAngle | The hue value as 360° angle, ussed to set the colorwheel dial rotation |
SetHueColor(Color)
sets the colorwheel module's color as HSV (Hue, Saturation, Value) using the given UnityEngine.Color
Declaration
public void SetHueColor(Color hueColor)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Color | hueColor | The color to set as HSV values to the colorwheel |
SetSaturationAndValue(Single, Single)
Set the S(aturation) and V(alue) components in HSV color representation to update the color dial position
Declaration
public void SetSaturationAndValue(float saturation, float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | saturation | The HSV saturation component to set in a range of 0.0 to 1.0. |
| System.Single | value | The HSV value component to set in a range of 0.0 to 1.0. |
TryCalculateHueAngle(PointerEventData, out Single)
Try to calculates the hue value (angle in degrees on unit circle) for the given pointer position on the colorwheel
Declaration
public bool TryCalculateHueAngle(PointerEventData eventData, out float hueAngle)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.EventSystems.PointerEventData | eventData | The UnityEngine.EventSystems.PointerEventData providing the pointer position and event camera for the calculation |
| System.Single | hueAngle | The hue angle (0 - 360) the given pointer position corresponds to. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if a valid hue angle was calculated, false otherwise. |
TryCalculateSaturationAndValue(PointerEventData, out Single, out Single)
Try to calculate the saturation and value components for the given pointer position on the color quad
Declaration
public bool TryCalculateSaturationAndValue(PointerEventData eventData, out float saturation, out float value)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.EventSystems.PointerEventData | eventData | The UnityEngine.EventSystems.PointerEventData providing the pointer position and event camera for the calculation |
| System.Single | saturation | The saturation component the given pointer position corresponds to. |
| System.Single | value | The value component the given pointer position corresponds to. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if valid values were calculated, false otherwise. |