colourfulmoon 0.0.1

Paint you terminal!


To use this package, run the following command in your project's root directory:


This package provides sub packages which can be used individually:

colourfulmoon:example - Example of ColourfulMoon use

ColourfulMoon

Paint your text simple!

Usage

There are 2 different ways to use ColourfulMoon.

  1. Just call the functions:
writeln(Bold(Underline("Text")));

This is a bad way - it is hard to read this code.

  1. Use std.stdio style:
"Text".Bold.Underline.writeln;

So, just use second way.

Functions

  • Reset. Resets styles.
  • Bold. Makes text bold.
  • Underline. Underlines text.
  • Blink. Make text blinked.
  • Reverse. Reverses Foreground <-> Background.
  • Foreground Colour text face to given R, G, B.
  • Backround Colour text background to given R, G, B.

Understanding operation order

All functions (except Reset) are applying right-to-left.

"Text".Bold.Underline.Reverse.Blink.writeln;
// <-------------------------------

As first, text become blinked, then reversed, then underlined, then bolded.

Foreground and Background doesn't rewritable! You can't do something like this:

"text".Foreground(0, 0, 0).Bold.Foreground(156, 156, 156).writeln;
// Text has colour 156,156,156, not 0,0,0.

To reset style of text - use Reset:

"text".Foreground(0, 0, 0).Bold.Reset.Foreground(156, 156, 156).writeln;
// <-----------------------------------------------------
//                                ---------->
// Reset works from left-to-right. Now text has 0,0,0 colour.

Example

Aviable in ./example.

TODO

  • [ ] Speed up code by use of Ranges or something like this
  • [ ] Windows support
  • [ ] Test on BSD, OS X, etc.
Authors:
  • Azbuka-slovensko
Sub packages:
colourfulmoon:example
Dependencies:
none
Versions:
1.0.2 2016-Aug-11
1.0.1 2016-May-05
1.0.0 2016-Apr-12
0.1.0 2016-Apr-10
0.0.1 2016-Feb-13
Show all 6 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 1 downloads this month

  • 375 downloads total

Score:
0.7
Short URL:
colourfulmoon.dub.pm