printex v0.1.2 Printex

Documentation for Printex.

Printex is a Color Printer Module,helps you to print the data and strings in color format in console.

Use

This module separates the different console outputs with different colors and including background colors as well. It gives you the direct focus on the console by highlighting text with colors and backgrounds.

You can use in multiple ways like printing the :error message and many formats. This helps you identify message from the regular out put of the console. You can also specify the :bg_color - Background color for the text to lay on. For more examples and screen shots and how to usage check the github

NOTE

Color may look different in different Terminals or Consoles or whatever the :stdout

Summary

Functions

This prints the given text in the format you specified. The string formats are as follows :x_on_y here {x,y} can be any 8 possible colors

Prints the given data with the label provided.If the label is not provided label data is used. How ever you can say not to use the label by passing :no_label option

Examples

print("print with out label",:no_label)
print("Normal Print")
print([1,2,3])

Usage

You can use this function in three different ways.

  1. Using the default label format.print("hello")
  2. With out any label text. print("hello",:no_label)
  3. Passing label option as string. print("hello","greeting") here the text greeting is treated as :label 3.1 Passing label option as list. print("hello",label: "greeting")

Prints the given message in the error format in the red color

Prints the given message in the information format in the green color

Prints the given message in the warning format in the yellow color

Prints the only binary to the console with colors specified This function prints the string passed in the color you specified or else it uses the default format for printing i.e regular format IO.puts

Functions

color_print(string, format)
color_print(binary, atom) :: list

This prints the given text in the format you specified. The string formats are as follows :x_on_y here {x,y} can be any 8 possible colors

  1. black
  2. blue
  3. cyan
  4. green
  5. magenta
  6. red
  7. white
  8. yellow

In addition you can also specify respective light combination of colors

Usage

:black_on_white
prints the text in black color with white background. :red_on_light_green
prints the text in red color with light_green background. :light_blue_on_light_cyan
prints the text in light_blue color with light_cyan background.

x_on_y format colors

x_on_y image

print(data, label \\ :default)

Prints the given data with the label provided.If the label is not provided label data is used. How ever you can say not to use the label by passing :no_label option

Examples

print("print with out label",:no_label)
print("Normal Print")
print([1,2,3])

Usage

You can use this function in three different ways.

  1. Using the default label format.print("hello")
  2. With out any label text. print("hello",:no_label)
  3. Passing label option as string. print("hello","greeting") here the text greeting is treated as :label 3.1 Passing label option as list. print("hello",label: "greeting")

print function

print image

prints(arg1)

Prints the only binary to the console with colors specified This function prints the string passed in the color you specified or else it uses the default format for printing i.e regular format IO.puts

Examples

iex> Printex.prints("message")
This prints the message in default color
iex> Printex.prints("message",:red)
This prints the message in red color
iex> Printex.prints {"message",:red}
This prints the message in  red color
iex> Printex.prints (%{string: "message",color: :red})
This prints the message in  red color
iex> Printex.prints ("message",:red,:white)
This prints the message in red color with white background          

Text with foreground color

Prints Image

Text with background colors

Prints Image

prints(string, color \\ :white)
prints(string, color, bg_color)