Mercurial
diff infinite_canvas/theme.h @ 276:b55c22cff335
Add interactive infinite canvas prototype
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 17 Aug 2026 16:57:56 -0700 |
| parents | |
| children | 8d560f50ed4c |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/infinite_canvas/theme.h Mon Aug 17 16:57:56 2026 -0700 @@ -0,0 +1,41 @@ +#ifndef INFINITE_CANVAS_THEME_H +#define INFINITE_CANVAS_THEME_H + +#include "dowa/dowa.h" +#include "third_party/raylib/include/raylib.h" + +typedef enum { + CANVAS_THEME_AUTO = 0, + CANVAS_THEME_LIGHT, + CANVAS_THEME_DARK, +} Canvas_Theme_Mode; + +typedef struct { + Canvas_Theme_Mode requested_mode; + Canvas_Theme_Mode resolved_mode; + Color background; + Color surface; + Color surface_muted; + Color border; + Color text; + Color text_muted; + Color accent; + Color accent_soft; + Color shadow; + Color toast_surface; + Color toast_border; +} Canvas_Theme; + +Canvas_Theme_Mode Canvas_Theme_Mode_From_String(const char *p_value); +boolean Canvas_System_Prefers_Dark(void); +void Canvas_Theme_Resolve(Canvas_Theme *p_theme, Canvas_Theme_Mode mode); +void Canvas_Theme_Toggle(Canvas_Theme *p_theme); +void Canvas_Theme_Draw_Shadow( + const Canvas_Theme *p_theme, + Rectangle bounds, + float roundness, + int32 segments, + float zoom, + float opacity); + +#endif