5#include "TinyGPU/Color/RGB565.h"
6#include "TinyGPU/Color/RGB666.h"
7#include "TinyGPU/Color/RGB888.h"
8#include "TinyGPU/Fonts.h"
9#include "TinyMaterialDesign/Theme/MaterialColors.h"
17template <
typename RGB_T>
18RGB_T
blend(RGB_T a, RGB_T b,
float t) {
19 t = std::min(1.0f, std::max(0.0f, t));
20 auto lerp = [t](uint8_t x, uint8_t y) {
21 return static_cast<uint8_t>(x + (
static_cast<
float>(y) - x) * t);
23 return RGB_T(lerp(a.getRed(), b.getRed()), lerp(a.getGreen(), b.getGreen()),
24 lerp(a.getBlue(), b.getBlue()));
39template <
typename RGB_T>
64template <
typename RGB_T>
66 static tinygpu::Font5x7<RGB_T> label;
67 static tinygpu::Font8x8<RGB_T> body;
68 static tinygpu::Font12x12<RGB_T> title;
69 static tinygpu::Font16x24<RGB_T> headline;
70 return Typography<RGB_T>{&label, &body, &title, &headline};
76 theme.colors = lightColorScheme<RGB_T>();
77 theme.typography = defaultTypography<RGB_T>();
84 theme.colors = darkColorScheme<RGB_T>();
85 theme.typography = defaultTypography<RGB_T>();
95 theme.colors = blueColorScheme<RGB_T>();
96 theme.typography = defaultTypography<RGB_T>();
103 theme.colors = blueDarkColorScheme<RGB_T>();
104 theme.typography = defaultTypography<RGB_T>();
111 theme.colors = greenColorScheme<RGB_T>();
112 theme.typography = defaultTypography<RGB_T>();
119 theme.colors = greenDarkColorScheme<RGB_T>();
120 theme.typography = defaultTypography<RGB_T>();
127 theme.colors = redColorScheme<RGB_T>();
128 theme.typography = defaultTypography<RGB_T>();
135 theme.colors = redDarkColorScheme<RGB_T>();
136 theme.typography = defaultTypography<RGB_T>();
143 theme.colors = orangeColorScheme<RGB_T>();
144 theme.typography = defaultTypography<RGB_T>();
151 theme.colors = orangeDarkColorScheme<RGB_T>();
152 theme.typography = defaultTypography<RGB_T>();
Definition: AnchorLayout.h:4
MaterialTheme< RGB_T > greenDarkTheme()
Definition: MaterialTheme.h:117
MaterialTheme< RGB_T > greenTheme()
Definition: MaterialTheme.h:109
RGB_T blend(RGB_T a, RGB_T b, float t)
Definition: MaterialTheme.h:18
MaterialTheme< RGB_T > blueTheme()
Definition: MaterialTheme.h:93
MaterialTheme< RGB_T > defaultDarkTheme()
Definition: MaterialTheme.h:82
MaterialTheme< RGB_T > redDarkTheme()
Definition: MaterialTheme.h:133
MaterialTheme< RGB_T > blueDarkTheme()
Definition: MaterialTheme.h:101
Typography< RGB_T > defaultTypography()
Definition: MaterialTheme.h:65
MaterialTheme< RGB_T > redTheme()
Definition: MaterialTheme.h:125
MaterialTheme< RGB_T > orangeDarkTheme()
Definition: MaterialTheme.h:149
MaterialTheme< RGB_T > defaultTheme()
Definition: MaterialTheme.h:74
MaterialTheme< RGB_T > orangeTheme()
Definition: MaterialTheme.h:141
Material Design 3 color roles.
Definition: MaterialColors.h:24
Bundles a color scheme, shape tokens, typography, and spacing into one theme, passed to widgets so th...
Definition: MaterialTheme.h:50
int32_t spacing
Definition: MaterialTheme.h:54
bool enableRipple
Definition: MaterialTheme.h:58
Typography< RGB_T > typography
Definition: MaterialTheme.h:53
ColorScheme< RGB_T > colors
Definition: MaterialTheme.h:51
ShapeTokens shape
Definition: MaterialTheme.h:52
Material 3 shape-scale corner radii, in pixels.
Definition: MaterialTheme.h:28
int32_t large
Definition: MaterialTheme.h:31
int32_t small
Definition: MaterialTheme.h:29
int32_t medium
Definition: MaterialTheme.h:30
int32_t full
Definition: MaterialTheme.h:35
Typography roles, each backed by one of TinyGPU's bitmap fonts.
Definition: MaterialTheme.h:40
tinygpu::IFont< RGB_T > * title
Definition: MaterialTheme.h:43
tinygpu::IFont< RGB_T > * body
Definition: MaterialTheme.h:42
tinygpu::IFont< RGB_T > * label
Definition: MaterialTheme.h:41
tinygpu::IFont< RGB_T > * headline
Definition: MaterialTheme.h:44