mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-05 14:10:31 -04:00
Add colors utilities (#121)
* Add colors utilities Local function get_base_color(), conversions hex <=> rgb, rgb color mixer, and global function get_color() * Round numbers to avoid eventual float in string.format * Simplify inbox/outbox mixing of color Use a single if statement for each property and concatenate to displayed_color then execute mail.get_color(displayed_color) instead of making many combined if statements * Convert 3-chars hex colors to 6-chars hex colors Could break the code, the hex convert to rgb always run on 6-chars * Rework color utility using tables Instead of one-letter symbols, it now supports tables of identifiers or single strings
This commit is contained in:
parent
802f9f727b
commit
3bad371353
15 changed files with 86 additions and 61 deletions
|
@ -9,7 +9,7 @@ local maillists_formspec = "size[8,9;]" .. mail.theme .. [[
|
|||
button[6,1.60;2,0.5;delete;]] .. S("Delete") .. [[]
|
||||
button[6,8.25;2,0.5;back;]] .. S("Back") .. [[]
|
||||
tablecolumns[color;text;text]
|
||||
table[0,0;5.75,9;maillists;]] .. mail.colors.header .. "," .. S("Name") .. "," .. S("Note")
|
||||
table[0,0;5.75,9;maillists;]] .. mail.get_color("header") .. "," .. S("Name") .. "," .. S("Note")
|
||||
|
||||
function mail.show_maillists(name)
|
||||
local formspec = { maillists_formspec }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue