-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Types and functions used to represent SGR aspects
--   
--   The 'ANSI' standards refer to the visual style of displaying
--   characters as their 'graphic rendition'. The 'ANSI' codes to establish
--   the graphic rendition for subsequent text are referred to as SELECT
--   GRAPHIC RENDITION (SGR). This package exposes modules that export
--   types and functions used to represent SGR aspects.
@package ansi-terminal-types
@version 0.11.5


-- | The 'ANSI' standards refer to the visual style of displaying
--   characters as their 'graphic rendition'. The style includes the color
--   of a character or its background, the intensity (bold, normal or
--   faint) of a character, or whether the character is italic or
--   underlined (single or double), blinking (slowly or rapidly) or visible
--   or not. The 'ANSI' codes to establish the graphic rendition for
--   subsequent text are referred to as SELECT GRAPHIC RENDITION (SGR).
--   
--   This module exports types and functions used to represent SGR aspects.
--   See also <a>setSGR</a> and related functions provided by the
--   <tt>ansi-terminal</tt> package.
module System.Console.ANSI.Types

-- | ANSI Select Graphic Rendition (SGR) command
--   
--   In respect of colors, there are three alternative commands:
--   
--   <ol>
--   <li>the 'ANSI' standards allow for eight standard colors (with two
--   intensities). Windows and many other terminals (including xterm) allow
--   the user to redefine the standard colors (so, for example <a>Vivid</a>
--   <a>Green</a> may not correspond to bright green;</li>
--   <li>an extension of the standard that allows true colors (24 bit color
--   depth) in RGB space. This is usually the best alternative for more
--   colors; and</li>
--   <li>another extension that allows a palette of 256 colors, each color
--   specified by an index. Xterm provides a protocol for a palette of 256
--   colors that many other terminals, including Windows 10, follow. Some
--   terminals (including xterm) allow the user to redefine some or all of
--   the palette colors.</li>
--   </ol>
data SGR

-- | Default rendition, cancels the effect of any preceding occurrence of
--   SGR (implementation-defined)
Reset :: SGR

-- | Set the character intensity. Partially supported natively on Windows
--   10
SetConsoleIntensity :: !ConsoleIntensity -> SGR

-- | Set italicized. Not widely supported: sometimes treated as swapping
--   foreground and background. Not supported natively on Windows 10
SetItalicized :: !Bool -> SGR

-- | Set or clear underlining. Partially supported natively on Windows 10
SetUnderlining :: !Underlining -> SGR

-- | Set or clear character blinking. Not supported natively on Windows 10
SetBlinkSpeed :: !BlinkSpeed -> SGR

-- | Set revealed or concealed. Not widely supported. Not supported
--   natively on Windows 10
SetVisible :: !Bool -> SGR

-- | Set negative or positive image. Supported natively on Windows 10
SetSwapForegroundBackground :: !Bool -> SGR

-- | Set a color from the standard palette of 16 colors (8 colors by 2
--   color intensities). Many terminals allow the palette colors to be
--   customised
SetColor :: !ConsoleLayer -> !ColorIntensity -> !Color -> SGR

-- | Set a true color (24 bit color depth). Supported natively on Windows
--   10 from the Creators Update (April 2017)
SetRGBColor :: !ConsoleLayer -> !Colour Float -> SGR

-- | Set a color from a palette of 256 colors using a numerical index
--   (0-based). Supported natively on Windows 10 from the Creators Update
--   (April 2017) but not on legacy Windows native terminals. See
--   <a>xtermSystem</a>, <a>xterm6LevelRGB</a> and <a>xterm24LevelGray</a>
--   to construct indices based on xterm's standard protocol for a
--   256-color palette.
SetPaletteColor :: !ConsoleLayer -> !Word8 -> SGR

-- | Set a color to the default (implementation-defined)
SetDefaultColor :: !ConsoleLayer -> SGR

-- | ANSI colors can be set on two different layers
data ConsoleLayer
Foreground :: ConsoleLayer
Background :: ConsoleLayer

-- | ANSI's eight standard colors. They come in two intensities, which are
--   controlled by <a>ColorIntensity</a>. Many terminals allow the colors
--   of the standard palette to be customised, so that, for example,
--   <tt>setSGR [ SetColor Foreground Vivid Green ]</tt> may not result in
--   bright green characters.
data Color
Black :: Color
Red :: Color
Green :: Color
Yellow :: Color
Blue :: Color
Magenta :: Color
Cyan :: Color
White :: Color

-- | ANSI's standard colors come in two intensities
data ColorIntensity
Dull :: ColorIntensity
Vivid :: ColorIntensity

-- | ANSI general console intensity: usually treated as setting the font
--   style (e.g. <a>BoldIntensity</a> causes text to be bold)
data ConsoleIntensity
BoldIntensity :: ConsoleIntensity

-- | Not widely supported: sometimes treated as concealing text. Not
--   supported natively on Windows 10
FaintIntensity :: ConsoleIntensity
NormalIntensity :: ConsoleIntensity

-- | ANSI text underlining
data Underlining
SingleUnderline :: Underlining

-- | Not widely supported. Not supported natively on Windows 10
DoubleUnderline :: Underlining
NoUnderline :: Underlining

-- | ANSI blink speeds: values other than <a>NoBlink</a> are not widely
--   supported
data BlinkSpeed

-- | Less than 150 blinks per minute
SlowBlink :: BlinkSpeed

-- | More than 150 blinks per minute
RapidBlink :: BlinkSpeed
NoBlink :: BlinkSpeed

-- | Given xterm's standard protocol for a 256-color palette, returns the
--   index to that part of the palette which is a 6 level (6x6x6) color
--   cube of 216 RGB colors. Throws an error if any of the red, green or
--   blue channels is outside the range 0 to 5. An example of use is:
--   
--   <pre>
--   &gt;&gt;&gt; setSGR [ SetPaletteColor $ xterm6LevelRGB 5 2 0 ] -- Dark Orange
--   </pre>
xterm6LevelRGB :: Int -> Int -> Int -> Word8

-- | Given xterm's standard protocol for a 256-color palette, returns the
--   index to that part of the palette which is a spectrum of 24 grays,
--   from dark gray (0) to near white (23) (black and white are themselves
--   excluded). Throws an error if the gray is outside of the range 0 to
--   23. An example of use is:
--   
--   <pre>
--   &gt;&gt;&gt; setSGR [ SetPaletteColor $ xterm24LevelGray 12 ] -- Gray50
--   </pre>
xterm24LevelGray :: Int -> Word8

-- | Given xterm's standard protocol for a 256-color palette, returns the
--   index to that part of the palette which corresponds to the 'ANSI'
--   standards' 16 standard, or 'system', colors (eight colors in two
--   intensities). An example of use is:
--   
--   <pre>
--   &gt;&gt;&gt; setSGR [ SetPaletteColor $ xtermSystem Vivid Green ]
--   </pre>
xtermSystem :: ColorIntensity -> Color -> Word8
instance GHC.Show.Show System.Console.ANSI.Types.Color
instance GHC.Read.Read System.Console.ANSI.Types.Color
instance GHC.Classes.Ord System.Console.ANSI.Types.Color
instance GHC.Ix.Ix System.Console.ANSI.Types.Color
instance GHC.Classes.Eq System.Console.ANSI.Types.Color
instance GHC.Enum.Enum System.Console.ANSI.Types.Color
instance GHC.Enum.Bounded System.Console.ANSI.Types.Color
instance GHC.Show.Show System.Console.ANSI.Types.ColorIntensity
instance GHC.Read.Read System.Console.ANSI.Types.ColorIntensity
instance GHC.Classes.Ord System.Console.ANSI.Types.ColorIntensity
instance GHC.Ix.Ix System.Console.ANSI.Types.ColorIntensity
instance GHC.Enum.Enum System.Console.ANSI.Types.ColorIntensity
instance GHC.Classes.Eq System.Console.ANSI.Types.ColorIntensity
instance GHC.Enum.Bounded System.Console.ANSI.Types.ColorIntensity
instance GHC.Show.Show System.Console.ANSI.Types.ConsoleLayer
instance GHC.Read.Read System.Console.ANSI.Types.ConsoleLayer
instance GHC.Classes.Ord System.Console.ANSI.Types.ConsoleLayer
instance GHC.Ix.Ix System.Console.ANSI.Types.ConsoleLayer
instance GHC.Enum.Enum System.Console.ANSI.Types.ConsoleLayer
instance GHC.Classes.Eq System.Console.ANSI.Types.ConsoleLayer
instance GHC.Enum.Bounded System.Console.ANSI.Types.ConsoleLayer
instance GHC.Show.Show System.Console.ANSI.Types.BlinkSpeed
instance GHC.Read.Read System.Console.ANSI.Types.BlinkSpeed
instance GHC.Classes.Ord System.Console.ANSI.Types.BlinkSpeed
instance GHC.Ix.Ix System.Console.ANSI.Types.BlinkSpeed
instance GHC.Enum.Enum System.Console.ANSI.Types.BlinkSpeed
instance GHC.Classes.Eq System.Console.ANSI.Types.BlinkSpeed
instance GHC.Enum.Bounded System.Console.ANSI.Types.BlinkSpeed
instance GHC.Show.Show System.Console.ANSI.Types.Underlining
instance GHC.Read.Read System.Console.ANSI.Types.Underlining
instance GHC.Classes.Ord System.Console.ANSI.Types.Underlining
instance GHC.Ix.Ix System.Console.ANSI.Types.Underlining
instance GHC.Enum.Enum System.Console.ANSI.Types.Underlining
instance GHC.Classes.Eq System.Console.ANSI.Types.Underlining
instance GHC.Enum.Bounded System.Console.ANSI.Types.Underlining
instance GHC.Show.Show System.Console.ANSI.Types.ConsoleIntensity
instance GHC.Read.Read System.Console.ANSI.Types.ConsoleIntensity
instance GHC.Classes.Ord System.Console.ANSI.Types.ConsoleIntensity
instance GHC.Ix.Ix System.Console.ANSI.Types.ConsoleIntensity
instance GHC.Enum.Enum System.Console.ANSI.Types.ConsoleIntensity
instance GHC.Classes.Eq System.Console.ANSI.Types.ConsoleIntensity
instance GHC.Enum.Bounded System.Console.ANSI.Types.ConsoleIntensity
instance GHC.Show.Show System.Console.ANSI.Types.SGR
instance GHC.Read.Read System.Console.ANSI.Types.SGR
instance GHC.Classes.Eq System.Console.ANSI.Types.SGR
