clan::Style Class Reference - ClanLib SDK
Description: clan::Style Class Reference

Public Member Functions | Static Public Member Functions | List of all members
clan::Style Class Reference

Style property set. More...

`#include <style.h>`

## Public Member Functions
| Style ()
| Style (const Style &)=delete
| ~Style ()
StyleGetValue | declared_value (PropertyHash hash) const
| Retrieve the declared value for a property.
Style & | operator= (const Style &)=delete
void | set (const std::string &properties)
template<class Arg1, typename... Values>
void | set (const std::string &properties, Arg1 arg1, Values... values)

## Static Public Member Functions
static std::string | to_rgba (const Colorf &c)
| Static helper that generates a "rgba(%1,%2,%3,%4)" string for the given color.

## Detailed Description

Style property set.

## Constructor & Destructor Documentation

## ◆ Style() [1/2]

clan::Style::Style | ( |  | ) |

Referenced by Style(), and operator=().

## ◆ Style() [2/2]

clan::Style::Style | ( | const Style & |  | ) |
| delete

References Style().

## ◆ ~Style()

clan::Style::~Style | ( |  | ) |

## Member Function Documentation

## ◆ declared_value()

StyleGetValue clan::Style::declared_value | ( | PropertyHash | hash | ) | const

Retrieve the declared value for a property.

## ◆ operator=()

Style & clan::Style::operator= | ( | const Style & |  | ) |
| delete

References Style().

## ◆ set() [1/2]

void clan::Style::set | ( | const std::string & | properties | ) |

Parse and apply CSS properties to property set

The properties string uses the same syntax as when styles are specified using the 'style' attribute in HTML. This function does not clear the current properties already set and can be called multiple times with individual sets of properties.

Additional arguments can be passed in and will be inserted with the same syntax as when using the string_format function.

Referenced by set().

## ◆ set() [2/2]

template<class Arg1, typename... Values>

void clan::Style::set | ( | const std::string & | properties,
|  | Arg1 | arg1,
|  | Values... | values )
| inline

References set(), and clan::string_format().

## ◆ to_rgba()

std::string clan::Style::to_rgba | ( | const Colorf & | c | ) |
| inlinestatic

Static helper that generates a "rgba(%1,%2,%3,%4)" string for the given color.

References clan::c, clan::clamp(), and clan::string_format().

The documentation for this class was generated from the following file:

- style.h