Copyright | (c) 2020 Kowainik (c) 2022 Dmitrii Kovanikov |
---|---|
License | MPL-2.0 |
Maintainer | Dmitrii Kovanikov <kovanikov@gmail.com> |
Stability | Experimental |
Portability | Portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The ColourMode
data type that allows disabling and enabling of
colouring.
Since: 0.0.0.0
Synopsis
- data ColourMode
- handleColourMode :: Handle -> IO ColourMode
Documentation
data ColourMode Source #
Data type that tells whether the colouring is enabled or
disabled. Its value is detected automatically on application start and
stored in CliEnv
.
Since: 0.0.0.0
DisableColour | Since: 0.0.0.0 |
EnableColour | Since: 0.0.0.0 |
Instances
handleColourMode :: Handle -> IO ColourMode Source #
Returns ColourMode
of a Handle
. You can use this function on
output Handle
s to find out whether they support colouring or
not.
Use a function like this to check whether you can print with colour to terminal:
handleColourMode
stdout
Since: 0.0.0.0