/usr/share/genometools/gtdata/spec/ansicolors.lua is in genometools-common 1.5.10+ds-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | local pairs = pairs
local tostring = tostring
local setmetatable = setmetatable
local schar = string.char
module 'ansicolors'
local colormt = {}
function colormt:__tostring()
return self.value
end
function colormt:__concat(other)
return tostring(self) .. tostring(other)
end
function colormt:__call(s)
return self .. s .. _M.reset
end
colormt.__metatable = {}
local function makecolor(value)
return setmetatable({ value = schar(27) .. '[' .. tostring(value) .. 'm' }, colormt)
end
local colors = {
-- attributes
reset = 0,
clear = 0,
bright = 1,
dim = 2,
underscore = 4,
blink = 5,
reverse = 7,
hidden = 8,
-- foreground
black = 30,
red = 31,
green = 32,
yellow = 33,
blue = 34,
magenta = 35,
cyan = 36,
white = 37,
-- background
onblack = 40,
onred = 41,
ongreen = 42,
onyellow = 43,
onblue = 44,
onmagenta = 45,
oncyan = 46,
onwhite = 47,
}
for c, v in pairs(colors) do
_M[c] = makecolor(v)
end
|