Coder Social home page Coder Social logo

e7dal / colourista Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kowainik/colourista

0.0 1.0 0.0 34 KB

β€ŽοΈβ€πŸŒˆ Convenient interface for printing colourful messages

Home Page: https://kowainik.github.io/projects/colourista

License: Mozilla Public License 2.0

Haskell 100.00%

colourista's Introduction

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.1
                 , ...
  2. In the module where you wish to use the colourful output with colourista, you should add the import:

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

    import qualified Data.Text as Text
    
    main :: IO ()
    main = successMessage $ Text.pack "All set up!"

Usage with Stack

If colourista is not available on your current Stackage resolver yet, fear not! You can still use it from Hackage by adding the following to the extra-deps section of your stack.yaml file:

extra-deps:
  - colourista-0.1.0.0
  - ...

Then you can add it as a dependency in your package.yaml file as usual:

library:
  dependencies:
    - colourista

Great!

Acknowledgement

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

colourista's People

Contributors

vrom911 avatar chshersh avatar skaex avatar danieljharvey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.