1# colours for consoles 2 3=begin 4Copyright 2009, 2012 Andrew Horton 5 6This file is part of WhatWeb. 7 8WhatWeb is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or at your option) any later version. 9 10WhatWeb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 12You should have received a copy of the GNU General Public License along with WhatWeb. If not, see <http://www.gnu.org/licenses/>. 13=end 14 15 16def colorize(text, color_code) 17"#{color_code}#{text}\e[0m" 18end 19 20def red(text); colorize(text, "\e[1m\e[31m"); end 21def dark_red(text); colorize(text, "\e[31m"); end 22def green(text); colorize(text, "\e[1m\e[32m"); end 23def dark_green(text); colorize(text, "\e[32m"); end 24def yellow(text); colorize(text, "\e[1m\e[33m"); end 25def dark_yellow(text); colorize(text, "\e[33m"); end 26def blue(text); colorize(text, "\e[1m\e[34m"); end 27def dark_blue(text); colorize(text, "\e[34m"); end 28def magenta(text); colorize(text, "\e[1m\e[35m"); end 29def dark_magenta(text); colorize(text, "\e[35m"); end 30def cyan(text); colorize(text, "\e[1m\e[36m"); end 31def dark_cyan(text); colorize(text, "\e[36m"); end 32def white(text); colorize(text, "\e[1m\e[37m"); end 33def grey(text); colorize(text, "\e[37m"); end 34 35