Module: Quiyo::Colors

Included in:
Quiyo
Defined in:
lib/quiyo/colors.rb

Instance Method Summary collapse

Instance Method Details

#colorize(text, color_code) ⇒ Object



3
4
5
# File 'lib/quiyo/colors.rb', line 3

def colorize(text, color_code)
	"\001\e[38;5;#{color_code}m\002#{text}\001\e[0m\002"
end

#printsonglist(song) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/quiyo/colors.rb', line 7

def printsonglist(song)
	print "[%s] %s : %s [%s]\n" % [
	                               song["pos"],
	                               colorize(song["artist"], CONF["colors"]["artist"]),
	                               colorize(song["title"], CONF["colors"]["title"]),
	                               colorize(song["album"], CONF["colors"]["album"])
	                              ]
end