dzen-utils-0.1.1: Utilities for creating inputs for dzen.

Portabilitysemi-portable (uses MPTC and type families)
Stabilityexperimental
Maintainerfelipe.lessa@gmail.com
Safe HaskellSafe-Infered

System.Dzen.Colour

Contents

Description

Support for colours. This module is entirely based on the colour package, so we strongly recommend that you at least

 import qualified Data.Colour.Names as C

which will import various aliases for creating Colours.

Note changing the colours using the functions below do not hinder the use of automatic padding.

Synopsis

Changing colours

type DColour = Colour DoubleSource

Our colours.

fg :: Transform a => DColour -> a -> aSource

Set the foreground colour. Note that the foreground colour is changed only inside the transformed DString or Printer, unlike using "^fg" which may affect subsequent strings.

So you may write fg black (fg lime (str "lime") +++ str "black") and it works like you expect it to.

bg :: Transform a => DColour -> a -> aSource

Like fg, but set the background colour.

Reseting to the defaults

defFg :: Transform a => a -> aSource

Set the foreground colour to be the default one, which is specified as a parameter to dzen (outside the control of the printers).

defBg :: Transform a => a -> aSource

Like defFg, but for the background colour.

Change or reset

changeFg :: Transform a => Maybe DColour -> a -> aSource

Set the foreground to be a specified one (Just c) or the dzen's default (Nothing). Both fg and defFg are specializations of this function.

changeBg :: Transform a => Maybe DColour -> a -> aSource

Like changeFg, but for the background colour.