-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolors.lua
More file actions
33 lines (21 loc) · 701 Bytes
/
colors.lua
File metadata and controls
33 lines (21 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- functions relating to displayed colors, but these are generic functions not related to a specific display/bartype
function AutoColorValue(value, thresholds)
local color=""
for i,thresh in ipairs(thresholds)
do
if value >= thresh.value then color=thresh.color end
end
return color
end
function TranslateColorName(name)
if name=="black" then return("~n") end
if name=="white" then return("~w") end
if name=="cyan" then return("~c") end
if name=="blue" then return("~b") end
if name=="green" then return("~g") end
if name=="yellow" then return("~y") end
if name=="magenta" then return("~m") end
if name=="orange" then return("~r") end
if name=="red" then return("~r") end
return("")
end