printex v1.1.0 Printex

Documentation for Printex

Printex helps you to print the data and strings in color text and color backgrounds. It make use of the IO.ANSI Module.

Why Printex ?

This module prints the different console outputs with different colors and background colors as well.

Idea

We can see a lot of lines with regular text in your console at the time of development. It will be hard to identify any of your IO.inspect statements output in your console. I thought, it would be nice to highlight our inspect statements outputs to distinguish from the regular lines already present in the console.

It gives you the direct focus on the console by highlighting text with colors and backgrounds.

You can use this in multiple ways like printing the :error message and many formats as well.

This helps you to identify the 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

Colors may vary from terminal to terminal...

Link to this section 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

Prints the given message in the error format. It uses :red as a foreground text color

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

This helps to print the list with number of units we need

This function helps to print a map with optons

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

This function puts the string accordingly to the given params. The first argument should be the binary.
The second parameter is the foreground color that you what the string to be print, and the third parameter is the background color used for printing the string. However, passing colors are optional

Link to this section Functions

Link to this function

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 white 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

Link to this function

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("I Print with Deafault label DATA")
print([1,2,3])
print("I print with Label", "Your Label Here")

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

This function puts the string accordingly to the given params. The first argument should be the binary.
The second parameter is the foreground color that you what the string to be print, and the third parameter is the background color used for printing the string. However, passing colors are optional.

The colors are to be of type atom and at present the following colors have been supported

[:black,:blue,:cyan,:green,:magenta,:red,:white,:yellow]`

However, it is optional to pass the color. By default it uses yellow background with black foreground

Examples

iex> Printex.prints("message")
This FG Color `yellow` & BG Color 'black',

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

Link to this function

prints(string, color \\ :yellow)

Link to this function

prints(string, color, bg_color)