dice-gui-old/src/style.h

123 lines
2.5 KiB
C++

#ifndef STYLE_H
#define STYLE_H
#include "defs.h"
#include "resources.h" // needed for macros
#include <clay/clay.h>
#include <stdint.h>
////////////////////////////////////
// WINDOW STYLE
////////////////////////////////////
constexpr uint16_t windowPadding = 10;
constexpr float windowBackground = 0.15f;
////////////////////////////////////
// CONTAINER STYLE
////////////////////////////////////
constexpr uint16_t containerGap = 10;
constexpr double defaultRadius = 5.0;
constexpr float panelBackground[] = {
.2f,
.3f,
.4f
};
constexpr float panelBorder[] = {
.3f,
.4f,
.5f
};
constexpr Clay_Padding panelPadding = {
24, 24,
24, 24,
};
#define PANEL(depth_)\
backgroundColor = PanelBackground(depth_),\
.border = { PanelBackground(depth_), CLAY_BORDER_ALL(2) },\
.cornerRadius = defaultRadiusAll
////////////////////////////////////
// TEXT STYLE
////////////////////////////////////
constexpr float paragraphGap = 10;
constexpr uint16_t baseFontSize = 16;
constexpr float textColorsP[] = {
0.9f,
0.9f,
0.9f
};
constexpr uint16_t headerSizes[] = {
64, 32,
28, 16
};
#define BODY()\
fontId = FONT_DEFAULT,\
.fontSize = baseFontSize
#define H(level_)\
fontId = FONT_BOLD,\
.fontSize = headerSizes[(level_)-1]
////////////////////////////////////
// BUTTONS
////////////////////////////////////
constexpr Clay_Color warningButton = {
177, 56, 52, 255
};
constexpr Clay_Color proceedButton = {
49, 181, 99, 255
};
constexpr Clay_Padding buttonPadding = {
24, 24,
4, 4,
};
constexpr Clay_CornerRadius buttonRadii = {
3, 3, 3, 3
};
constexpr Clay_Color dieColors[] = {
{ 230, 184, 48, 255 },
{ 177, 56, 52, 255 },
{ 115, 177, 52, 255 },
{ 52, 177, 125, 255 },
{ 52, 177, 176, 255 },
{ 52, 93, 177, 255 },
{ 177, 52, 140, 255 },
{ 95, 52, 177, 255 },
};
////////////////////////////////////
// COMPILATIONS
// | Functions and expressions that combine styling data from the settings above.
////////////////////////////////////
constexpr Clay_Sizing layoutExpand = {
.width = CLAY_SIZING_GROW(0),
.height = CLAY_SIZING_GROW(0)
};
constexpr Clay_CornerRadius defaultRadiusAll = {
defaultRadius, defaultRadius,
defaultRadius, defaultRadius
};
extern Clay_Color PanelBackground(size_t idx);
extern Clay_Color PanelBackground(size_t idx);
extern Clay_Color TextColors(size_t idx);
extern Clay_Color WindowBackground();
extern Clay_ElementDeclaration WindowStyle();
extern Clay_Color DieColor(enum Dice_Die die);
extern Clay_Color DieButtonColor(enum Dice_Die die, bool selected);
extern Clay_Color ToHoveredColor(Clay_Color color);
#endif // !STYLE_H