orbtk_theme/
lib.rs

1/*!
2
3This crate provides the default theme resources of OrbTks default theme dark and light.
4It provides fonts, icons and colors.
5
6 */
7
8use orbtk_theming::{config::ThemeConfig, prelude::*};
9
10/// provides `constants` to reference colors.
11pub mod colors;
12/// provides `constants` associated to fonts.
13pub mod fonts;
14pub mod prelude;
15/// provides information processed by the `graphic render` (e.g. glyphs, icons).
16pub mod vector_graphics;
17
18/// The dark theme resource file.
19pub const DARK_THEME_RON: &str = include_str!("../assets/dark/dark.ron");
20
21/// The default theme colors resource file.
22pub const COLORS_RON: &str = include_str!("../assets/common/colors.ron");
23
24/// The common fonts resource file.
25pub const FONTS_RON: &str = include_str!("../assets/common/fonts.ron");
26
27/// The light theme resource file.
28pub const LIGHT_THEME_RON: &str = include_str!("../assets/light/light.ron");
29
30/// Creates OrbTks default dark theme.
31pub fn dark_theme() -> Theme {
32    Theme::from_config(
33        ThemeConfig::from(DARK_THEME_RON)
34            .extend(ThemeConfig::from(COLORS_RON))
35            .extend(ThemeConfig::from(FONTS_RON)),
36    )
37}
38
39/// Creates OrbTks default light theme.
40pub fn light_theme() -> Theme {
41    Theme::from_config(
42        ThemeConfig::from(LIGHT_THEME_RON)
43            .extend(ThemeConfig::from(COLORS_RON))
44            .extend(ThemeConfig::from(FONTS_RON)),
45    )
46}