This represents a parsed value of a css property.
Public Member Functions | |
Value () | |
Creates a new empty value. More... | |
Value (string text) | |
Creates a new value from the given value text and guesses what type it is. More... | |
Value (string text, ValueType type) | |
Creates a new value from the given value as text and a type of the value represented in the text. More... | |
bool | IsAuto () |
Checks if this is 'auto' More... | |
bool | IsAbsolute () |
Checks if this is an absolute value and is not a percentage/em/ rectangle containing percents. More... | |
bool | Equals (Value value) |
Checks if two values are equal. More... | |
void | MakeAbsolute (CssProperty property, Element element) |
Converts this relative value (such as a percentage or em) into a fixed one. More... | |
void | InheritFrom (Value parent) |
Inherits from the given parent value by copying them. More... | |
void | BakePX (int size) |
Converts the percentage held by this value into a fixed pixel number. More... | |
Value | Copy () |
Duplicates this value. More... | |
void | SetFloat (float value) |
Sets the given floating point number as the value. More... | |
float | ToFloat () |
Converts this value to a floating point number. More... | |
Color | ToColor () |
Converts this value to a Unity colour. More... | |
override string | ToString () |
Converts this value to a css useable string. More... | |
void | Reset () |
Empties this value. More... | |
void | Set (string valueText) |
Sets the value and guesses it's type. More... | |
void | Set (string valueText, ValueType type) |
Sets the value which is of a known given type. More... | |
int | GetMixed (int dimension) |
Resolves a mixed pixel and % value. More... | |
void | SetPercent (float percent) |
void | Offset (Value by) |
Offsets this percentage value by a given percentage or pixel value. More... | |
bool | AllSameValues () |
Are all entries in this rectangle the same? More... | |
string | GetText (int index) |
Gets the numbered inner values text. More... | |
float | GetRadians (int index) |
Gets the numbered inner values floating point number in radians. More... | |
float | GetFloat (int index) |
Gets the numbered inner values floating point number. More... | |
int | GetPX (int index) |
Gets the numbered inner value as pixels. More... | |
Color | GetColor (int index) |
Gets the numbered inner value as a colour. More... | |
string | ToHex () |
Converts this value into a hex string that is 2 characters long. More... | |
void | SetInnerValues (int count) |
Sets defaults for the given number of inner values. More... | |
void | SetInnerValues (string valueText, int count) |
Sets the given fixed number of inner values of this to the given css text string. More... | |
Static Public Member Functions | |
static Color | GetColour (string valueText) |
Gets a colour from a hex HTML string. More... | |
static void | GetColour (string valueText, out float r, out float g, out float b, out float a) |
static int | GetInnerIndex (ref string property) |
static ValueType | TypeOf (CssProperty property, ref string value) |
static bool | IsSingle (string valueText) |
static ValueType | TypeOf (string valueText) |
Public Attributes | |
int | PX |
If this is a pixel integer, the raw pixel value. More... | |
string | Text |
If this is a text value, e.g. "auto", the raw text value. More... | |
float | Single |
If this is a decimal, the raw decimal value. More... | |
bool | Boolean |
If this is a boolean, the raw bool value. More... | |
bool | Important |
True if this value is important. More... | |
Value[] | InnerValues |
The set of internal values, such as each individual value of padding. More... | |
Calculation | Calculation |
A calculation if this value is calc(..). More... | |
ValueType | Type =ValueType.Null |
The type of value this is. More... | |
Properties | |
Value | this[int index] [get, set] |
Gets or sets the numbered inner value. Used if this is a rectangle/ colour etc. More... | |
Private Member Functions | |
int | ParentFontSize (ComputedStyle style) |
Gets the fontsize for the given computed style. More... | |
string | InnerValueString () |
Static Private Member Functions | |
static int | DoubleNibble (int nibble) |
Duplicates the given nibble (4 bit number) and places the result alongside in the same byte. E.g. c in hex becomes cc. More... | |
|
inline |
Creates a new empty value.
|
inline |
Creates a new value from the given value text and guesses what type it is.
text | The value to set, e.g. "auto" or "14.9". |
|
inline |
Creates a new value from the given value as text and a type of the value represented in the text.
text | The value to set, e.g. "auto" or "14.9". |
type | The type of the value, e.g. percentage. |
|
inline |
Are all entries in this rectangle the same?
|
inline |
Converts the percentage held by this value into a fixed pixel number.
size | The number that represents 100%. |
|
inline |
Duplicates this value.
|
inlinestaticprivate |
Duplicates the given nibble (4 bit number) and places the result alongside in the same byte. E.g. c in hex becomes cc.
nibble | The nibble to duplicate. |
|
inline |
Checks if two values are equal.
value | The value to check for equality with this. Always returns false if null. |
|
inline |
Gets the numbered inner value as a colour.
index | The number of the inner value. |
|
inlinestatic |
Gets a colour from a hex HTML string.
|
inlinestatic |
|
inline |
Gets the numbered inner values floating point number.
index | The number of the inner value. |
|
inlinestatic |
|
inline |
Resolves a mixed pixel and % value.
|
inline |
Gets the numbered inner value as pixels.
index | The number of the inner value. |
|
inline |
Gets the numbered inner values floating point number in radians.
index | The number of the inner value. |
|
inline |
Gets the numbered inner values text.
index | The number of the inner value. |
|
inline |
Inherits from the given parent value by copying them.
parent | The value to inherit from. |
|
inlineprivate |
|
inline |
Checks if this is an absolute value and is not a percentage/em/ rectangle containing percents.
|
inline |
Checks if this is 'auto'
|
inlinestatic |
|
inline |
Converts this relative value (such as a percentage or em) into a fixed one.
property | The property that this value represents and is being made absolute. |
element | The element holding all the values that represent 100%. |
|
inline |
Offsets this percentage value by a given percentage or pixel value.
|
inlineprivate |
Gets the fontsize for the given computed style.
parentStyle | The style to get the fontsize from. Used for em calculations. |
|
inline |
Empties this value.
|
inline |
Sets the value and guesses it's type.
valueText | The value to set, e.g. "auto" or "14.9". |
|
inline |
Sets the value which is of a known given type.
text | The value to set, e.g. "auto" or "14.9". |
type | The type of the value, e.g. percentage. |
|
inline |
Sets the given floating point number as the value.
value | The value to set. |
|
inline |
Sets defaults for the given number of inner values.
count | The number of inner values to setup. |
|
inline |
Sets the given fixed number of inner values of this to the given css text string.
valueText | The value to use for the inner values separated by spaces. E.g. "50% 50%" |
count | The number of inner values this value should have. If the value text does not have enough chunks to fit in this number of inner values, the value text is repeated so they do. For example, "10 40" to fit in 4 inner values becomes "10 40 10 40"; "1 2 3" to fit in 4 becomes "1 2 3 1" etc. |
|
inline |
|
inline |
Converts this value to a Unity colour.
|
inline |
Converts this value to a floating point number.
|
inline |
Converts this value into a hex string that is 2 characters long.
|
inline |
Converts this value to a css useable string.
|
inlinestatic |
|
inlinestatic |
bool PowerUI.Css.Value.Boolean |
If this is a boolean, the raw bool value.
Calculation PowerUI.Css.Value.Calculation |
A calculation if this value is calc(..).
bool PowerUI.Css.Value.Important |
True if this value is important.
Value [] PowerUI.Css.Value.InnerValues |
The set of internal values, such as each individual value of padding.
int PowerUI.Css.Value.PX |
If this is a pixel integer, the raw pixel value.
float PowerUI.Css.Value.Single |
If this is a decimal, the raw decimal value.
string PowerUI.Css.Value.Text |
If this is a text value, e.g. "auto", the raw text value.
ValueType PowerUI.Css.Value.Type =ValueType.Null |
The type of value this is.
|
getset |
Gets or sets the numbered inner value. Used if this is a rectangle/ colour etc.
index | The number of the inner value. |