HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
theme_mode.hpp
1// Copyright Take Vos 2020-2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../utility/module.hpp"
8#include <string>
9#include <ostream>
10
11namespace hi::inline v1 {
12
13enum class theme_mode { light, dark };
14
15constexpr auto theme_mode_metadata = enum_metadata{theme_mode::light, "light", theme_mode::dark, "dark"};
16
17[[nodiscard]] inline std::string_view to_string(theme_mode rhs) noexcept
18{
19 return theme_mode_metadata[rhs];
20}
21
22inline std::ostream &operator<<(std::ostream &lhs, theme_mode rhs)
23{
24 return lhs << theme_mode_metadata[rhs];
25}
26
27} // namespace hi::inline v1
28
29template<typename CharT>
30struct std::formatter<hi::theme_mode, CharT> : std::formatter<std::string_view, CharT> {
31 auto format(hi::theme_mode const &t, auto &fc)
32 {
33 return std::formatter<std::string_view, CharT>::format(hi::theme_mode_metadata[t], fc);
34 }
35};
constexpr std::string to_string(std::u32string_view rhs) noexcept
Conversion from UTF-32 to UTF-8.
Definition to_string.hpp:215
DOXYGEN BUG.
Definition algorithm.hpp:13
@ light
300: Light
geometry/margins.hpp
Definition cache.hpp:11