Module: Sevgi::Function::Color

Included in:
Sevgi::Function
Defined in:
lib/sevgi/function/color.rb

Overview

ANSI color and style helpers for terminal output.

Instance Method Summary collapse

Instance Method Details

#blue(string) ⇒ String

Wraps a string in the blue terminal style.

Parameters:

  • string (Object)

    content to style

Returns:



10
# File 'lib/sevgi/function/color.rb', line 10

def blue(string) = "\e[1m\e[38;5;81m#{string}\e[0m"

#bold(string) ⇒ String

Wraps a string in the bold terminal style.

Parameters:

  • string (Object)

    content to style

Returns:



40
# File 'lib/sevgi/function/color.rb', line 40

def bold(string) = "\e[1m#{string}\e[0m"

#cyan(string) ⇒ String

Wraps a string in the cyan terminal style.

Parameters:

  • string (Object)

    content to style

Returns:



15
# File 'lib/sevgi/function/color.rb', line 15

def cyan(string) = "\e[1m\e[38;5;51m#{string}\e[0m"

#dim(string) ⇒ String

Wraps a string in the dim terminal style.

Parameters:

  • string (Object)

    content to style

Returns:



45
# File 'lib/sevgi/function/color.rb', line 45

def dim(string) = "\e[1m\e[2m#{string}\e[0m"

#green(string) ⇒ String

Wraps a string in the green terminal style.

Parameters:

  • string (Object)

    content to style

Returns:



20
# File 'lib/sevgi/function/color.rb', line 20

def green(string) = "\e[1m\e[38;5;35m#{string}\e[0m"

#magenta(string) ⇒ String

Wraps a string in the magenta terminal style.

Parameters:

  • string (Object)

    content to style

Returns:



25
# File 'lib/sevgi/function/color.rb', line 25

def magenta(string) = "\e[1m\e[38;5;200m#{string}\e[0m"

#red(string) ⇒ String

Wraps a string in the red terminal style.

Parameters:

  • string (Object)

    content to style

Returns:



30
# File 'lib/sevgi/function/color.rb', line 30

def red(string) = "\e[1m\e[38;5;197m#{string}\e[0m"

#yellow(string) ⇒ String

Wraps a string in the yellow terminal style.

Parameters:

  • string (Object)

    content to style

Returns:



35
# File 'lib/sevgi/function/color.rb', line 35

def yellow(string) = "\e[1m\e[38;5;227m#{string}\e[0m"