Sha256: 92bfc509917e0dc5b46af4be7795f8557712298ef7b94a54d02edf535b672b3f

Contents?: true

Size: 491 Bytes

Versions: 15

Compression:

Stored size: 491 Bytes

Contents

# Utility methods to display
# colored strings, e.g.,
# "foo".cyan, "bar".red, etc.
class String

  # @return [String]
  def blue
    "\e[1;34m#{self}\e[0m"
  end

  def green
    "\e[1;32m#{self}\e[0m"
  end

  def red
    "\e[1;31m#{self}\e[0m"
  end

  def yellow
    "\e[1;33m#{self}\e[0m"
  end

  def magenta
    "\e[1;35m#{self}\e[0m"
  end

  def cyan
    "\e[1;36m#{self}\e[0m"
  end

  def white
    "\e[1;37m#{self}\e[0m"
  end

  def black
    "\e[1;30m#{self}\e[0m"
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
asciidoctor-latex-1.5.0.17.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.16.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.15.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.14.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.13.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.12.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.11.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.10.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.9.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.8b.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.7.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.5.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.4.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.3.dev lib/asciidoctor/latex/core_ext/colored_string.rb
asciidoctor-latex-1.5.0.2.dev lib/asciidoctor/latex/core_ext/colored_string.rb