Add colors utilities

Local function get_base_color(), conversions hex <=> rgb, rgb color mixer, and global function get_color()
This commit is contained in:
Athozus 2023-11-05 16:30:56 +01:00
parent 2111db2ff9
commit 0b3497eb2f
No known key found for this signature in database
GPG key ID: B50895022E8484BF
15 changed files with 80 additions and 39 deletions

View file

@ -65,7 +65,7 @@ function mail.show_outbox(name, sortfieldindex, sortdirection, filter)
button[3.5,9.5;2.5,0.5;selectall;]] .. S("(Un)select all") .. [[]
tablecolumns[color;text;text]
table[0,0.7;5.75,7.45;outbox;]] .. mail.colors.header .. "," .. S("To") .. "," .. S("Subject")
table[0,0.7;5.75,7.45;outbox;]] .. mail.get_color("h") .. "," .. S("To") .. "," .. S("Subject")
local formspec = { outbox_formspec }
mail.message_drafts[name] = nil
@ -83,7 +83,7 @@ function mail.show_outbox(name, sortfieldindex, sortdirection, filter)
end
end
if selected_id > 0 then
formspec[#formspec + 1] = "," .. mail.colors.selected
formspec[#formspec + 1] = "," .. mail.get_color("s")
else
formspec[#formspec + 1] = ","
end