#include "style.h" #include "resources.h" #include namespace style { Clay_ElementDeclaration ListContainer(size_t depth, Clay_ElementDeclaration baseCfg) { baseCfg.border = { PanelBorder(depth), CLAY_BORDER_ALL(2) }; baseCfg.cornerRadius = defaultRadiusAll; return baseCfg; } Clay_ElementDeclaration PanelContainer(size_t depth, Clay_ElementDeclaration baseCfg) { baseCfg.backgroundColor = PanelBackground(depth); baseCfg.border = { PanelBorder(depth), CLAY_BORDER_OUTSIDE(2) }; baseCfg.cornerRadius = defaultRadiusAll; baseCfg.layout.padding = CLAY_PADDING_ALL(8); return baseCfg; } Clay_ElementDeclaration LeftPanelContainer(size_t depth, Clay_ElementDeclaration baseCfg) { baseCfg = PanelContainer(depth, baseCfg); baseCfg.border.width = { 0, 2, 2, 2, 0 }; baseCfg.cornerRadius = { 0, defaultRadius, 0, defaultRadius }; baseCfg.layout.sizing.height = CLAY_SIZING_GROW(); return baseCfg; } Clay_ElementDeclaration RightPanelContainer(size_t depth, Clay_ElementDeclaration baseCfg) { baseCfg = PanelContainer(depth, baseCfg); baseCfg.border.width = { 2, 0, 2, 2, 0 }; baseCfg.cornerRadius = { defaultRadius, 0, defaultRadius, 0 }; baseCfg.layout.sizing.height = CLAY_SIZING_GROW(); return baseCfg; } Clay_Color PanelBackground(size_t idx) { return { 255*panelBackground[idx], 255*panelBackground[idx], 255*panelBackground[idx], 255 }; } Clay_Color PanelBorder(size_t idx) { return { 255*panelBorder[idx], 255*panelBorder[idx], 255*panelBorder[idx], 255 }; } Clay_Color TextColor(size_t idx) { return { 255*textColorsP[idx], 255*textColorsP[idx], 255*textColorsP[idx], 255 }; } Clay_ElementDeclaration Window() { return { .layout = { .sizing = { CLAY_SIZING_GROW(), CLAY_SIZING_GROW() }, .padding = CLAY_PADDING_ALL(0), .childGap = 0, .layoutDirection = CLAY_LEFT_TO_RIGHT, }, }; } Clay_Color ToHoveredColor(Clay_Color color) { float avg = (color.r + color.g + color.b) / 3.f; color.r = (color.r - avg) * 0.8f + avg - 30; color.g = (color.g - avg) * 0.8f + avg - 30; color.b = (color.b - avg) * 0.8f + avg - 30; return color; } }