colourista: Convenient interface for printing colourful messages

[ ansi, library, mpl, terminal ] [ Propose Tags ]

Convenient interface for printing colourful messages based on the ansi-terminal library.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.0.0, 0.1.0.0, 0.1.0.1, 0.1.0.2
Change log CHANGELOG.md
Dependencies ansi-terminal (>=0.10 && <0.11), base (>=4.10.1.0 && <4.14), bytestring (>=0.10 && <0.11), text (>=1.2.3.0 && <1.3) [details]
License MPL-2.0
Copyright 2020 Kowainik
Author Veronika Romashkina, Dmitrii Kovanikov
Maintainer Kowainik <xrom.xkov@gmail.com>
Category Terminal, ANSI
Home page https://github.com/kowainik/colourista
Bug tracker https://github.com/kowainik/colourista/issues
Source repo head: git clone https://github.com/kowainik/colourista.git
Uploaded by vrom911 at 2020-02-16T20:27:02Z
Distributions Arch:0.1.0.2, Fedora:0.1.0.2, LTSHaskell:0.1.0.2, NixOS:0.1.0.2, Stackage:0.1.0.2, openSUSE:0.1.0.2
Reverse Dependencies 11 direct, 5 indirect [details]
Downloads 6809 total (117 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-02-16 [all 1 reports]

Readme for colourista-0.0.0.0

[back to package description]

colourista

logo

GitHub CI Build status Windows build status Hackage Stackage Lts Stackage Nightly MPL-2.0 license

«The best colour in the whole world is the one that looks good on you.»

— Coco Chanel

colourista is the library that provides a convenient interface for printing colourful messages to the terminal. It is based on ansi-terminal, however, in contradistinction to this Haskell library, colourista is a high-level wrapper focused on easily achieved output modification without low-level setup.

Interface

The two main functions that colourista provides are:

  • formatWith — the function that formats pure output by applying provided formatting codes. It works with polymorphic strings.
  • formattedMessage — the function that outputs the formatted output directly into the terminal (working in IO with Text).

The library also provides a set of different pure and impure helpers for the colouring and emphasis.

Example

output

How to use

colourista is compatible with the latest GHC compiler versions starting from 8.2.2.

In order to start using colourista in your project, you will need to set it up with the three easy steps:

  1. Add the dependency on colorista in your project's .cabal file. For this, you should modify the build-depends section by adding the name of this library. After the adjustment, this section could look like this:

    build-depends: base ^>= 4.14
                 , colourista ^>= 0.0
    
  2. In the module where you wish to use the colourful output with colourista, you should add the import:

    import Colourista (successMessage)
    
  3. Now you can use the functions from the library:

    main :: IO ()
    main = successMessage "All set up!"
    

Acknowledgement

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY.