A Gleam library for adding colours in terminal outputs.
Very important for building beautiful test suites or ncurses terminal apps.
Note: Colours working on Gleam 0.15.0 latest main branch
Colours is easy to use.
Just use any colour you want as a function. For foreground colour add
fg and for background color add
in front of any colour you want to use from color image.
will print Maroon in Maroon colour.
will print Maroon with Maroon background.
Colours supports this text effects:
- Bold (
- Italic (
Colours also supports RGB colors for both background and foreground:
colours.fg_rgb("Red Foreground", 255, 0, 0)
will print Red Foreground in Red colour.
colours.bg_rgb("Red Background", 255, 0, 0)
will print Red Background with Red background.
Note: RGB colors support only Natural numbers
Colours can be installed by typing:
gleam add colours
inside your project directory.
You can visit a hexdocs documentation generated by gleam here.