aboutsummaryrefslogtreecommitdiff
path: root/awesome.lua
diff options
context:
space:
mode:
Diffstat (limited to 'awesome.lua')
-rw-r--r--awesome.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/awesome.lua b/awesome.lua
new file mode 100644
index 0000000..f64fb46
--- /dev/null
+++ b/awesome.lua
@@ -0,0 +1,31 @@
+local utils = require "lib.utils"
+local oklab = require "lib.oklab"
+
+local palette = utils.get_palette()
+
+local output = [[-- autogenerated from palette.json
+local M = {}
+
+local function tone_set(colors)
+ return setmetatable(colors, {
+ __call = function(self)
+ return self[1]
+ end,
+ })
+end
+
+M.palette = {
+]]
+
+for name, value in utils.opairs(palette) do
+ output = output .. " " .. name .. " = tone_set {\n"
+ for variant, variant_value in utils.opairs(value) do
+ local color = oklab.rgb2hex(oklab.oklab2rgb(oklab.oklch2oklab(variant_value)))
+ output = output .. " " .. (variant == "normal" and [["]] or variant .. [[ = "]]) .. color .. "\",\n"
+ end
+ output = output .. " },\n"
+end
+
+output = output .. " transparent = \"#00000000\"\n}\n\nreturn M"
+
+print(output)