yui/theme.lua

40 lines
1.2 KiB
Lua
Raw Normal View History

--- Visual theme settings
2022-09-12 09:34:46 +02:00
--
-- @module yui.theme
-- @copyright 2022, The DoubleFourteen Code Forge
-- @author Lorenzo Cogotti, Andrea Pasquini
--- Defines common visual attributes and colors applied to every @{yui.Widget|Widget}.
--
-- @field cornerRadius (number) radius for rounded corners
-- @field font (love.graphics.Font) font used for text (defaults to love.graphics.getFont())
2022-09-12 09:34:46 +02:00
-- @field color (@{ColorPalette}) default @{yui.Widget|Widget} color theme
-- @table Theme
2022-09-12 09:34:46 +02:00
--- Defines which color corresponds to each @{yui.Widget|Widget} state.
--
-- @field hovered (@{Color}) color applied to hovered widgets
-- @field normal (@{Color}) color applied to widgets in their default state
-- @field active (@{Color}) color applied to active widgets
-- @table ColorPalette
--- A pair defining background and foreground colors.
--
-- @field bg (table) background color
-- @field fg (table) foreground color (typically used for text)
-- @table Color
2022-08-15 23:41:17 +02:00
local theme = {
cornerRadius = 4,
-- font = nil defaults to love.graphics.getFont()
2022-08-15 23:41:17 +02:00
color = {
normal = {bg = { 0.25, 0.25, 0.25}, fg = {0.73, 0.73, 0.73}},
hovered = {bg = { 0.19, 0.6, 0.73}, fg = {1, 1, 1}},
active = {bg = { 1, 0.6, 0}, fg = {1, 1, 1}}
}
}
return theme