Differences From
Artifact [a001c55363]:
1 1 local l = sorcery.lib
2 2 local dui = sorcery.data.ui
3 3
4 4 return {
5 5 tooltip = function(a)
6 - local color = a.color
6 + local color = a.color and a.color:readable()
7 7 if color == nil then color = l.color(136,158,177) end
8 8 local str = a.title
9 9 if a.desc then
10 10 str = str .. '\n' .. color:fmt(minetest.wrap_text(a.desc,60))
11 11 end
12 12 if a.props then
13 13 -- str = str .. '\n'
14 14 for _,prop in pairs(a.props) do
15 15 local c
16 16 if prop.color and l.color.id(prop.color) then
17 - c = prop.color
17 + c = prop.color:readable()
18 18 elseif dui.colors[prop.affinity] then
19 19 c = l.color(dui.colors[prop.affinity])
20 20 else
21 21 c = l.color(dui.colors.neutral)
22 22 end
23 23
24 24 str = str .. '\n ' .. c:fmt('* ')
25 25
26 26 if prop.title then
27 27 str = str .. c:brighten(1.3):fmt(prop.title) .. ': '
28 28 end
29 29
30 - local lines = minetest.wrap_text(prop.desc, 50, true)
30 + local lines = minetest.wrap_text(prop.desc, 55, true)
31 31 str = str .. c:fmt(lines[1])
32 32 for i=2,#lines do
33 33 str = str .. '\n' .. string.rep(' ',5) .. c:fmt(lines[i])
34 34 end
35 35 end
36 36 end
37 - return str
37 + return color:darken(0.8):bg(str)
38 38 end;
39 39 }