Sha256: 05abdb6d2eefe4793cef64ac0138a0eae1de8a1ae1514cc80a80b536a6204f4b
Contents?: true
Size: 374 Bytes
Versions: 16
Compression:
Stored size: 374 Bytes
Contents
module Paint # Standalone helpers which add functionality you sometimes need when working with terminal colors class << self # Removes any color and effect strings def unpaint(string) string.gsub(/\e\[(?:[0-9];?)+m/, '') end # Creates a random ANSI color def random(background = false) (background ? 40 : 30) + rand(8) end end end
Version data entries
16 entries across 16 versions & 3 rubygems