Toast Engine
Loading...
Searching...
No Matches
assets::ColorScheme Class Reference
Inheritance diagram for assets::ColorScheme:
Collaboration diagram for assets::ColorScheme:

Public Member Functions

 ColorScheme (const toml::table &table, Handle< Schema > schema={})
auto type () const -> std::string_view override
void reload (const toml::table &table) override
 Re-parses the asset contents in place.
auto color (std::string_view name) const -> std::optional< glm::vec4 >
 Looks a color up by name.
auto hex (std::string_view name) const -> std::optional< std::string >
 Same lookup returning a #RRGGBBAA string.
Public Member Functions inherited from assets::Data
 Data (const toml::table &table, Handle< Schema > schema={})
 Data (const toml::table &table, Handle< Schema > schema, KeepAllKeysTag)
 Stores the schema handle for round-trip serialization but runs free-form buildRoot, keeping every TOML key.
auto type () const -> std::string_view override
auto operator[] (std::string_view k) -> DataValue &
auto operator[] (std::string_view k) const -> const DataValue &
auto contains (std::string_view k) const -> bool
auto root () const -> const DataValue &
auto schema () const -> const Handle< Schema > &
auto serialize (SaveMode mode) const -> std::vector< uint8_t > override
Public Member Functions inherited from assets::Asset
 Asset (const Asset &)=delete
auto operator= (const Asset &) -> Asset &=delete
auto refCount () const noexcept -> uint32_t

Static Public Member Functions

static auto toHex (glm::vec4 color) -> std::string
 Formats a color as #RRGGBBAA.

Additional Inherited Members

Static Public Attributes inherited from assets::Data
static constexpr KeepAllKeysTag keep_all_keys {}
Protected Member Functions inherited from assets::Data
virtual void onReloaded ()
Protected Member Functions inherited from assets::Asset
void addRef () noexcept
void release () noexcept
Protected Attributes inherited from assets::Data
DataValue m_root
 Object DataValue holding all fields.
Handle< Schema > m_schema
 optional
bool m_keep_all_keys = false

Member Function Documentation

◆ reload()

void assets::ColorScheme::reload ( const toml::table & table)
overridevirtual

Re-parses the asset contents in place.

Reimplemented from assets::Data.

Here is the caller graph for this function:

◆ type()

auto assets::ColorScheme::type ( ) const -> std::string_view
inlinenodiscardoverridevirtual

Implements assets::Asset.


The documentation for this class was generated from the following files:
  • engine/src/toast/ui/assets/color_scheme.hpp
  • engine/src/toast/ui/assets/color_scheme.cpp