highlight-1.0.0.2: Command line tool for highlighting parts of files matching a regex.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Highlight.Common.Color

Synopsis

Documentation

colorForFileNumber :: Int -> ByteString Source #

Find the corresponding color for the number in allColorsList, taking the mod of the Int.

>>> colorForFileNumber 0
"\ESC[1m\ESC[94m"
>>> colorForFileNumber 1
"\ESC[1m\ESC[92m"
>>> colorForFileNumber 4
"\ESC[1m\ESC[94m"

allColorsMap :: IntMap ByteString Source #

allColorsList turned into an IntMap for faster lookup.

allColorsList :: [ByteString] Source #

List of all the colors that are used for highlighting filenames.

colorBold :: ByteString Source #

Change the intensity to BoldIntensity.

colorReset :: ByteString Source #

Reset the console color back to normal.

colorNull :: ByteString Source #

Empty string.

colorHelper :: ColorIntensity -> Color -> ByteString Source #

Helper for creating a ByteString for an ANSI escape sequence color based on a ColorIntensity and a Color.

setSGRCodeBuilder :: [SGR] -> ByteString Source #

Convert a list of SGR to a ByteString.