Export a Theme's design tokens to various output formats.
More...
#include <design_export.hpp>
|
| static std::string | to_json (const Theme &theme) |
| | Export to JSON (round-trippable with Theme::from_json).
|
| static std::string | to_css (const Theme &theme, const std::string &prefix="pulp") |
| | Export to CSS custom properties.
|
| static std::string | to_cpp_header (const Theme &theme, const std::string &namespace_name) |
| | Export to a C++ header with constexpr color/dimension values.
|
| static std::string | to_oklch_css (const Theme &theme, const std::string &prefix="pulp") |
| | Export to OKLCH CSS color format.
|
| static std::string | to_wgsl_uniforms (const Theme &theme, const std::string &struct_name="ThemeUniforms") |
| | Export to GPU shader uniform declarations (WGSL).
|
Export a Theme's design tokens to various output formats.
Design tokens are the structured data behind a plugin's visual identity: colors, dimensions, typography, widget geometry, and rendering styles.
Theme theme = load_theme(
"dark.json");
static std::string to_json(const Theme &theme)
Export to JSON (round-trippable with Theme::from_json).
static std::string to_cpp_header(const Theme &theme, const std::string &namespace_name)
Export to a C++ header with constexpr color/dimension values.
static std::string to_css(const Theme &theme, const std::string &prefix="pulp")
Export to CSS custom properties.
◆ to_cpp_header()
| std::string pulp::view::DesignExport::to_cpp_header |
( |
const Theme & | theme, |
|
|
const std::string & | namespace_name ) |
|
static |
Export to a C++ header with constexpr color/dimension values.
namespace my_theme {
constexpr uint32_t kBackground = 0xFF1a1a2e;
constexpr float kKnobSize = 60.0f;
}
◆ to_css()
| std::string pulp::view::DesignExport::to_css |
( |
const Theme & | theme, |
|
|
const std::string & | prefix = "pulp" ) |
|
static |
Export to CSS custom properties.
:root {
--
pulp-background: #1a1a2e;
}
@ px
Absolute pixels.
Definition geometry.hpp:393
@ knob
Definition design_ir.hpp:260
Definition analyzer_provider.hpp:12
◆ to_json()
| std::string pulp::view::DesignExport::to_json |
( |
const Theme & | theme | ) |
|
|
static |
◆ to_oklch_css()
| std::string pulp::view::DesignExport::to_oklch_css |
( |
const Theme & | theme, |
|
|
const std::string & | prefix = "pulp" ) |
|
static |
Export to OKLCH CSS color format.
--
pulp-accent: oklch(0.628 0.258 12.5);
◆ to_wgsl_uniforms()
| std::string pulp::view::DesignExport::to_wgsl_uniforms |
( |
const Theme & | theme, |
|
|
const std::string & | struct_name = "ThemeUniforms" ) |
|
static |
Export to GPU shader uniform declarations (WGSL).
struct ThemeUniforms {
background: vec4<f32>,
accent: vec4<f32>,
knob_size: f32,
};
The documentation for this class was generated from the following file: