colourfulmoon ~master

Paint you terminal!


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

Manual usage
Put the following dependency into your project's dependences section:


This package provides sub packages which can be used individually:

colourfulmoon:example - Example of ColourfulMoon use

ColourfulMoon Page on DUB Licence

Paint your text simple!

Windows support

Noway. Colouring in Windows is so different from POSIX, that all API of ColourfulMoon must be changed. ColourfulMoon is designed for most easy and readable API. Use other libraries if you need Windows support.

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 Colour(R, G, B).
  • Backround Colour text background to given Colour(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 left-to-right. Now text has 0,0,0 colour.

Example

Aviable in ./example.

Authors:
  • Azbuka
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

  • 0 downloads this month

  • 1367 downloads total

Score:
0.7
Short URL:
colourfulmoon.dub.pm