Module
Choku
- Package
- purescript-choku
- Repository
- m15a/purescript-choku
This module imports and re-exports some default submodules for convenience, namely
Choku.Common
Choku.Color
Choku.Style
Choku.Stdout
The last one, Choku.Stdout
, might not be for your use case,
as it works in Eff
and customized for the STDOUT stream.
To use chalk in Aff
, import Choku.Stdout.Aff
or Choku.Stderr.Aff
instead.
To use chalk for the STDERR stream, import Choku.Stderr
or Choku.Stderr.Aff
instead.
Re-exports from Choku.Color
Re-exports from Choku.Common
#ColorSupportLevel Source
data ColorSupportLevel
Level of color support.
| Level | Int | Description |
| ---------------- | --- | ------------------------------------- |
| `HasNoColors` | 0 | All colors disabled |
| `HasBasicColors` | 1 | Basic color support (16 colors) |
| `Has256Colors` | 2 | 256 color support |
| `Has16mColors` | 3 | Truecolor support (16 million colors) |
See also https://github.com/chalk/chalk#chalklevel.
Constructors
Instances
#mkChoku Source
mkChoku :: ColorSupportLevel -> Choku
Create a new chalk instance with the specified level of color support.
#level Source
level :: Choku -> ColorSupportLevel
Return the color support level of the given chalk.
Re-exports from Choku.Stdout
#withStyle Source
withStyle :: String -> Style -> Effect String
Modify a string, using the default chalk for STDOUT, with the given style.
For example,
import Prelude
import Effect.Console
import Data.Maybe
import Partial.Unsafe
import Choku
log =<< "hello" `withStyle` (inverse >>> underline)
prints an inversed and underlined "hello"
string.
#supportsColor Source
Re-exports from Choku.Style
#whiteBright Source
whiteBright :: Style
#greenBright Source
greenBright :: Style
#cyanBright Source
cyanBright :: Style
#blueBright Source
blueBright :: Style
#blackBright Source
blackBright :: Style
#bgRedBright Source
bgRedBright :: Style
RGB digits. Each channel has the 8-bit range
0
to255
.