local palette = { dark = { debug = "#ed5eed", error = "#ec6376", warning = "#f0ee69", info = "#3ec5e3", content = { normal = "#ededed", backdrop = "#121212", accent = "#d151d1", minor = "#8b8b8b", focus = "#7ba1aa", unfocus = "#5d5d5d", important_local = "#b59ae4", important_global = "#dfd3f3", }, ui = { normal = "#dbdbdb", backdrop = "#242424", accent = "#d86dd8", minor = "#9d9d9d", focus = "#9aabae", unfocus = "#6f6f6f", important_local = "#c9b6eb", important_global = "#f3effb", }, }, light = { debug = "#a112a1", error = "#bd172e", warning = "#6e6c10", info = "#116477", content = { normal = "#121212", backdrop = "#ededed", accent = "#ae2eae", minor = "#3b3b3b", focus = "#184e5b", unfocus = "#6f6f6f", important_local = "#715696", important_global = "#4f3c69", }, ui = { normal = "#242424", backdrop = "#dbdbdb", accent = "#922792", minor = "#292929", focus = "#15333b", unfocus = "#5d5d5d", important_local = "#604980", important_global = "#3e2f53", }, }, } local M = {} function M.mode() local path = os.getenv("HOME") .. "/.cache/nugu/mode" local file = io.open(path, "r") if not file then return "dark" end local mode = file:read("*l") or "dark" file:close() if mode == "light" then return "light" end return "dark" end function M.current() return palette[M.mode()] end function M.get(mode) return palette[mode] end function M.hex(color) return color:gsub("#", "") end function M.rgba(color, alpha) return "rgba(" .. M.hex(color) .. (alpha or "ff") .. ")" end function M.rgb(color) return "rgb(" .. M.hex(color) .. ")" end return M