Safe Haskell | None |
---|---|
Language | Haskell2010 |
Game.LambdaHack.Definition.Color
Description
Colours and text attributes.
Synopsis
- data Color
- defFG :: Color
- isBright :: Color -> Bool
- darkCol :: [Color]
- brightCol :: [Color]
- stdCol :: [Color]
- legalFgCol :: [Color]
- colorToRGB :: Color -> Text
- data Highlight
- data Attr = Attr {}
- highlightToColor :: Highlight -> Color
- defAttr :: Attr
- data AttrChar = AttrChar {}
- newtype AttrCharW32 = AttrCharW32 {
- attrCharW32 :: Word32
- attrCharToW32 :: AttrChar -> AttrCharW32
- attrCharFromW32 :: AttrCharW32 -> AttrChar
- fgFromW32 :: AttrCharW32 -> Color
- bgFromW32 :: AttrCharW32 -> Highlight
- charFromW32 :: AttrCharW32 -> Char
- attrFromW32 :: AttrCharW32 -> Attr
- attrEnumFromW32 :: AttrCharW32 -> Int
- spaceAttrW32 :: AttrCharW32
- retAttrW32 :: AttrCharW32
- attrChar2ToW32 :: Color -> Char -> AttrCharW32
- attrChar1ToW32 :: Char -> AttrCharW32
Colours
Colours supported by the major frontends.
Constructors
Black | |
Red | |
Green | |
Brown | |
Blue | |
Magenta | |
Cyan | |
White | |
AltWhite | |
BrBlack | |
BrRed | |
BrGreen | |
BrYellow | |
BrBlue | |
BrMagenta | |
BrCyan | |
BrWhite |
Instances
Enum Color Source # | |
Defined in Game.LambdaHack.Definition.Color | |
Eq Color Source # | |
Ord Color Source # | |
Read Color Source # | |
Show Color Source # | |
Generic Color Source # | |
Hashable Color Source # | |
NFData Color Source # | |
Defined in Game.LambdaHack.Definition.Color | |
Binary Color Source # | |
type Rep Color Source # | |
Defined in Game.LambdaHack.Definition.Color type Rep Color = D1 ('MetaData "Color" "Game.LambdaHack.Definition.Color" "LambdaHack-0.9.5.0-FWRdmmndH5GD6eZFvncKh2" 'False) ((((C1 ('MetaCons "Black" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Red" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Green" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Brown" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Blue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Magenta" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Cyan" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "White" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "AltWhite" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BrBlack" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BrRed" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BrGreen" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "BrYellow" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BrBlue" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BrMagenta" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "BrCyan" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BrWhite" 'PrefixI 'False) (U1 :: Type -> Type)))))) |
legalFgCol :: [Color] Source #
Colour sets.
colorToRGB :: Color -> Text Source #
Translationg to heavily modified Linux console color RGB values.
Warning: SDL frontend sadly duplicates this code.
Complete text attributes
Additional map cell highlight, e.g., a colorful square around the cell or a colorful background.
Note: the highlight underscored by the terminal cursor is the maximal element of this type present of this screen.
Constructors
HighlightNone | |
HighlightGreen | |
HighlightBlue | |
HighlightGrey | |
HighlightWhite | |
HighlightMagenta | |
HighlightRed | |
HighlightYellow | |
HighlightYellowAim | |
HighlightRedAim | |
HighlightNoneCursor |
Instances
Bounded Highlight Source # | |
Enum Highlight Source # | |
Defined in Game.LambdaHack.Definition.Color Methods succ :: Highlight -> Highlight # pred :: Highlight -> Highlight # fromEnum :: Highlight -> Int # enumFrom :: Highlight -> [Highlight] # enumFromThen :: Highlight -> Highlight -> [Highlight] # enumFromTo :: Highlight -> Highlight -> [Highlight] # enumFromThenTo :: Highlight -> Highlight -> Highlight -> [Highlight] # | |
Eq Highlight Source # | |
Ord Highlight Source # | |
Defined in Game.LambdaHack.Definition.Color | |
Show Highlight Source # | |
Generic Highlight Source # | |
type Rep Highlight Source # | |
Defined in Game.LambdaHack.Definition.Color type Rep Highlight = D1 ('MetaData "Highlight" "Game.LambdaHack.Definition.Color" "LambdaHack-0.9.5.0-FWRdmmndH5GD6eZFvncKh2" 'False) (((C1 ('MetaCons "HighlightNone" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HighlightGreen" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "HighlightBlue" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "HighlightGrey" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HighlightWhite" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "HighlightMagenta" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "HighlightRed" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HighlightYellow" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "HighlightYellowAim" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "HighlightRedAim" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HighlightNoneCursor" 'PrefixI 'False) (U1 :: Type -> Type))))) |
Text attributes: foreground color and highlight.
highlightToColor :: Highlight -> Color Source #
Characters with attributes
Character to display, with its attribute.
newtype AttrCharW32 Source #
Optimized representation of AttrChar
.
Constructors
AttrCharW32 | |
Fields
|
Instances
attrCharToW32 :: AttrChar -> AttrCharW32 Source #
fgFromW32 :: AttrCharW32 -> Color Source #
bgFromW32 :: AttrCharW32 -> Highlight Source #
charFromW32 :: AttrCharW32 -> Char Source #
attrFromW32 :: AttrCharW32 -> Attr Source #
attrEnumFromW32 :: AttrCharW32 -> Int Source #
attrChar2ToW32 :: Color -> Char -> AttrCharW32 Source #
attrChar1ToW32 :: Char -> AttrCharW32 Source #