125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
end;
int = function(self)
return bit.bor(bit.lshift(self:int24(), 8), math.floor(0xff*(self.alpha or 1.0)))
end;
fmt = function(self, text) return
minetest.colorize(self:hex(), text)
end;
bg = function(self, text) return
text .. minetest.get_background_escape_sequence(self:hex())
end;
lum = function(self) return
(self.red + self.green + self.blue) / 3
end;
pair = function(self) --> bg, fg
|
|
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
end;
int = function(self)
return bit.bor(bit.lshift(self:int24(), 8), math.floor(0xff*(self.alpha or 1.0)))
end;
fmt = function(self, text) return
core.colorize(self:hex(), text)
end;
bg = function(self, text) return
text .. core.get_background_escape_sequence(self:hex())
end;
lum = function(self) return
(self.red + self.green + self.blue) / 3
end;
pair = function(self) --> bg, fg
|