Class SVSquare
SVSquare UI element. It is a square that allows to select a color by selecting a point in a 2D space.
The X axis represents the Hue and the Y axis represents the Saturation.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class SVSquare : BaseVisualElement, IEventHandler, IVisualElementScheduler, IExperimentalFeatures, ITransitionAnimations, ITransform, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<Vector2>, IValidatableElement<Vector2>, INotifyValueChanging<Vector2>, INotifyValueChanged<Vector2>
Constructors
SVSquare()
Default constructor.
Declaration
public SVSquare()
Fields
imageUssClassName
The SVSquare image styling class.
Declaration
public const string imageUssClassName = "appui-svsquare__image"
Field Value
Type | Description |
---|---|
string |
thumbSwatchUssClassName
The SVSquare thumb swatch styling class.
Declaration
public const string thumbSwatchUssClassName = "appui-svsquare__thumbswatch"
Field Value
Type | Description |
---|---|
string |
thumbUssClassName
The SVSquare thumb styling class.
Declaration
public const string thumbUssClassName = "appui-svsquare__thumb"
Field Value
Type | Description |
---|---|
string |
ussClassName
The SVSquare main styling class.
Declaration
public const string ussClassName = "appui-svsquare"
Field Value
Type | Description |
---|---|
string |
Properties
brightness
Selected brightness value.
Declaration
public float brightness { get; set; }
Property Value
Type | Description |
---|---|
float |
incrementFactor
The increment factor used when the user uses the keyboard to change the value.
Declaration
public float incrementFactor { get; set; }
Property Value
Type | Description |
---|---|
float |
invalid
The SVSquare invalid state.
Declaration
public bool invalid { get; set; }
Property Value
Type | Description |
---|---|
bool |
referenceColor
The reference color (current hue with the maximum brightness and saturation).
Declaration
public Color referenceColor { get; }
Property Value
Type | Description |
---|---|
Color |
referenceHue
The current hue used to display the SV Square.
Declaration
public float referenceHue { get; set; }
Property Value
Type | Description |
---|---|
float |
saturation
Selected saturation value.
Declaration
public float saturation { get; set; }
Property Value
Type | Description |
---|---|
float |
selectedColor
The currently selected color.
Declaration
public Color selectedColor { get; }
Property Value
Type | Description |
---|---|
Color |
validateValue
The SVSquare validation function.
Declaration
public Func<Vector2, bool> validateValue { get; set; }
Property Value
Type | Description |
---|---|
Func<Vector2, bool> |
value
The current value of the SV Square. The x component is the saturation and the y component is the brightness.
Declaration
public Vector2 value { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
Methods
SetValueWithoutNotify(Vector2)
Sets the value without notifying the user of the change.
Declaration
public void SetValueWithoutNotify(Vector2 newValue)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | newValue | The new value to set. |