-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.hpp
More file actions
40 lines (31 loc) · 1.06 KB
/
theme.hpp
File metadata and controls
40 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "gnuplotpp/plot.hpp"
#include <filesystem>
namespace gnuplotpp {
/** @brief Versioned built-in theme identifiers. */
enum class ThemePreset { IEEE_Strict_v1, Science_v1, Tufte_Minimal_v1 };
/**
* @brief Save a reusable theme snapshot to a JSON file.
* @param path Output JSON path.
* @param spec Figure spec carrying style/palette/text settings.
* @return true on success.
*/
bool save_theme_json(const std::filesystem::path& path, const FigureSpec& spec);
/**
* @brief Load a theme snapshot from a JSON file.
* @param path Input JSON path.
* @param spec Figure spec updated in-place.
* @return true on success.
*/
bool load_theme_json(const std::filesystem::path& path, FigureSpec& spec);
/**
* @brief Apply a versioned built-in theme preset.
* @param spec Figure spec to update.
* @param preset Versioned theme preset.
*/
void apply_theme_preset(FigureSpec& spec, ThemePreset preset);
/**
* @brief Return stable string id for a versioned theme preset.
*/
const char* theme_preset_id(ThemePreset preset) noexcept;
} // namespace gnuplotpp