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
15
init.lua
15
init.lua
|
@ -35,19 +35,6 @@ mail = {
|
|||
settings_group = {},
|
||||
},
|
||||
|
||||
colors = {
|
||||
header = "#999",
|
||||
selected = "#72FF63",
|
||||
important = "#FFD700",
|
||||
additional = "#CCCCDD",
|
||||
imp_sel = "#B9EB32",
|
||||
add_sel = "#9FE6A0",
|
||||
imp_add = "#E6D26F",
|
||||
imp_add_sel = "#BFE16B",
|
||||
highlighted = "#608631",
|
||||
new = "#00F529"
|
||||
},
|
||||
|
||||
settings = {
|
||||
chat_notifications = {
|
||||
type = "bool", default = true, group = "notifications", index = 1,
|
||||
|
@ -113,6 +100,7 @@ end
|
|||
|
||||
-- sub files
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
dofile(MP .. "/util/init.lua")
|
||||
dofile(MP .. "/chatcommands.lua")
|
||||
dofile(MP .. "/migrate.lua")
|
||||
dofile(MP .. "/hud.lua")
|
||||
|
@ -122,7 +110,6 @@ dofile(MP .. "/gui.lua")
|
|||
dofile(MP .. "/onjoin.lua")
|
||||
-- sub directories
|
||||
dofile(MP .. "/ui/init.lua")
|
||||
dofile(MP .. "/util/init.lua")
|
||||
|
||||
-- migrate storage
|
||||
mail.migrate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue