struct Athena::Console::Formatter::OutputStyle

Overview

Default implementation of ACON::Formatter::OutputStyleInterface.

Included Modules

Defined in:

formatter/output_style.cr

Constructors

Instance Method Summary

Instance methods inherited from module Athena::Console::Formatter::OutputStyleInterface

add_option(option : Colorize::Mode) : Nil add_option, apply(text : String) : String apply, background=(background : Colorize::Color) background=, foreground=(foreground : Colorize::Color) foreground=, remove_option(option : Colorize::Mode) : Nil remove_option

Constructor Detail

def self.new(foreground : Colorize::Color | String = :default, background : Colorize::Color | String = :default, options : Colorize::Mode = :none) #

[View source]

Instance Method Detail

def add_option(option : Colorize::Mode) : Nil #

Adds a text mode to self.


[View source]
def add_option(option : String) : Nil #

:inherit:


[View source]
def apply(text : String) : String #

Applies self to the provided text.


[View source]
def background=(background : Colorize::Color) #

Sets the background color of self.


[View source]
def background=(color : String) #

:inherit:


[View source]
def foreground=(foreground : Colorize::Color) #

Sets the foreground color of self.


[View source]
def foreground=(foreground : String) #

:inherit:


[View source]
def href=(href : String | Nil) #

Sets the href that self should link to.


[View source]
def options=(options : Colorize::Mode) #

:inherit:


[View source]
def remove_option(option : Colorize::Mode) : Nil #

Removes a text mode to self.


[View source]
def remove_option(option : String) : Nil #

:inherit:


[View source]