#{ -- helper function to map time to JET color function timecolor(time) local r,g,b local year = 3600*24*30*12 local lapse = os.time() - time if lapse <= 1*year then r,g,b = 255, 255*(year-lapse)/year, 0 elseif lapse > 1*year and lapse < 2*year then r,g,b = 255*(lapse-year)/year, 255, 255*(2*year-lapse)/year elseif lapse >= 2*year then r,g,b = 0, 255*(lapse-2*year)/year, 255 end r = r > 255 and 255 or math.floor(r) r = r < 0 and 0 or math.floor(r) g = g > 255 and 255 or math.floor(g) g = g < 0 and 0 or math.floor(g) b = b > 255 and 255 or math.floor(b) b = b < 0 and 0 or math.floor(b) return r..','..g..','..b end function htmlescape(text) if text == nil then return "" end local esc, _ = text:gsub('&', '&'):gsub('<', '<'):gsub('>', '>') return esc end }#