32#include "../../Display/2D/color.h"
33#include "style_value_type.h"
34#include "style_dimension.h"
71 return _value.float_value.number;
87 return _value.float_value.dimension;
97 return Colorf(_value.color[0], _value.color[1], _value.color[2], _value.color[3]);
Floating point color description class (for float).
Definition color.h:799
Style value returned by style classes.
Definition style_get_value.h:40
Colorf color() const
Value color.
Definition style_get_value.h:94
bool is_undefined() const
Check if value is undefined.
Definition style_get_value.h:103
static StyleGetValue from_number(float number)
Create style value from a number.
Definition style_get_value.h:165
static StyleGetValue from_color(const Colorf &color)
Create style value from a color.
Definition style_get_value.h:171
static StyleGetValue from_url(const char *url)
Create style value from an url.
Definition style_get_value.h:168
StyleDimension dimension
Definition style_get_value.h:182
static StyleGetValue from_frequency(float freq, StyleDimension dimension=StyleDimension::hz)
Create style value from a frequency.
Definition style_get_value.h:156
const char * text() const
Text when the type is a text string.
Definition style_get_value.h:46
bool is_url() const
Check if value is an url.
Definition style_get_value.h:135
bool is_keyword(const std::string &keyword) const
Definition style_get_value.h:108
static StyleGetValue from_angle(float angle, StyleDimension dimension=StyleDimension::rad)
Create style value from an angle.
Definition style_get_value.h:150
static StyleGetValue from_resolution(float resolution, StyleDimension dimension=StyleDimension::dppx)
Create style value from a resolution.
Definition style_get_value.h:159
bool is_length() const
Check if value is a length.
Definition style_get_value.h:111
static StyleGetValue from_time(float t, StyleDimension dimension=StyleDimension::s)
Create style value from a time.
Definition style_get_value.h:153
bool is_keyword(const char *keyword) const
Definition style_get_value.h:107
static StyleGetValue from_string(const char *text)
Create style value from a string.
Definition style_get_value.h:144
bool is_keyword() const
Check if value is a keyword.
Definition style_get_value.h:106
bool is_resolution() const
Check if value is a resolution.
Definition style_get_value.h:123
StyleDimension dimension() const
Dimension used by value.
Definition style_get_value.h:78
StyleValueType type() const
Variant type.
Definition style_get_value.h:43
static StyleGetValue from_percentage(float percentage)
Create style value from a percentage.
Definition style_get_value.h:162
bool is_color() const
Check if value is a color.
Definition style_get_value.h:138
float number() const
Value number.
Definition style_get_value.h:60
static StyleGetValue from_length(float length, StyleDimension dimension=StyleDimension::px)
Create style value from a length.
Definition style_get_value.h:147
bool is_time() const
Check if value is a time.
Definition style_get_value.h:117
static StyleGetValue from_keyword(const char *keyword)
Create style value from a keyword.
Definition style_get_value.h:141
float number
Definition style_get_value.h:181
bool is_percentage() const
Check if value is a percentage.
Definition style_get_value.h:126
bool is_string() const
Check if value is a string.
Definition style_get_value.h:132
float color[4]
Definition style_get_value.h:184
struct clan::StyleGetValue::@310166331045014146003067152131114166337026132202::@316055004076145170141326104210227100115361202164 float_value
const char * text
Definition style_get_value.h:178
bool is_angle() const
Check if value is an angle.
Definition style_get_value.h:114
bool is_frequency() const
Check if value is a frequency.
Definition style_get_value.h:120
bool is_number() const
Check if value is a number.
Definition style_get_value.h:129
StyleValueType
Style value type.
Definition style_value_type.h:35
@ time
value is an angle
Definition style_value_type.h:45
@ length
value is a keyword
Definition style_value_type.h:38
@ url
value is a text string
Definition style_value_type.h:42
@ undefined
Definition style_value_type.h:36
@ color
value is an url
Definition style_value_type.h:43
@ angle
value is a color
Definition style_value_type.h:44
@ number
value is a percentage number
Definition style_value_type.h:40
@ string
value is a number
Definition style_value_type.h:41
@ resolution
value is a frequency
Definition style_value_type.h:47
@ percentage
value is a length
Definition style_value_type.h:39
@ keyword
value undefined
Definition style_value_type.h:37
@ frequency
value is a time
Definition style_value_type.h:46
StyleDimension
Unit of a style value.
Definition style_dimension.h:35
@ s
turns (1 in a full circle)
Definition style_dimension.h:54
@ hz
milliseconds
Definition style_dimension.h:56
@ px
Definition style_dimension.h:36
@ rad
gradians/gons/grades (400 in a full circle)
Definition style_dimension.h:52
@ dppx
dots per cm
Definition style_dimension.h:60
@ percentage
Number.
Definition style_token.h:45