LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Definition.Color

Contents

- Colours
- Complete text attributes
- Characters with attributes

Description

Colours and text attributes.

Synopsis

- data Color
  - = Black
  - | Red
  - | Green
  - | Brown
  - | Blue
  - | Magenta
  - | Cyan
  - | White
  - | AltWhite
  - | BrBlack
  - | BrRed
  - | BrGreen
  - | BrYellow
  - | BrBlue
  - | BrMagenta
  - | BrCyan
  - | BrWhite
- defFG :: Color
- isBright :: Color -> Bool
- darkCol :: [Color]
- brightCol :: [Color]
- stdCol :: [Color]
- legalFgCol :: [Color]
- cVeryBadEvent :: Color
- cBadEvent :: Color
- cRisk :: Color
- cGraveRisk :: Color
- cVeryGoodEvent :: Color
- cGoodEvent :: Color
- cVista :: Color
- cSleep :: Color
- cWakeUp :: Color
- cGreed :: Color
- cNeutralEvent :: Color
- cRareNeutralEvent :: Color
- cIdentification :: Color
- cMeta :: Color
- cBoring :: Color
- cGameOver :: Color
- cTutorialHint :: Color
- colorToRGB :: Color -> Text
- data Highlight
  - = HighlightNone
  - | HighlightBackground
  - | HighlightGreen
  - | HighlightBlue
  - | HighlightBrown
  - | HighlightCyan
  - | HighlightGrey
  - | HighlightWhite
  - | HighlightMagenta
  - | HighlightRed
  - | HighlightYellow
  - | HighlightYellowAim
  - | HighlightRedAim
  - | HighlightNoneCursor
- data Attr = Attr {
  - fg :: Color
  - bg :: Highlight
  }
- highlightToColor :: Highlight -> Color
- defAttr :: Attr
- data AttrChar = AttrChar {
  - acAttr :: Attr
  - acChar :: Char
  }
- newtype AttrCharW32 = AttrCharW32 {
  - attrCharW32 :: Word32
  }
- attrCharToW32 :: AttrChar -> AttrCharW32
- attrCharFromW32 :: AttrCharW32 -> AttrChar
- fgFromW32 :: AttrCharW32 -> Color
- bgFromW32 :: AttrCharW32 -> Highlight
- charFromW32 :: AttrCharW32 -> Char
- attrFromW32 :: AttrCharW32 -> Attr
- spaceAttrW32 :: AttrCharW32
- nbspAttrW32 :: AttrCharW32
- trimmedLineAttrW32 :: AttrCharW32
- attrChar2ToW32 :: Color -> Char -> AttrCharW32
- attrChar1ToW32 :: Char -> AttrCharW32

# Colours

data Color Source #

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

Instances details

Binary Color Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods put :: Color -> Put Source # get :: Get Color Source # putList :: [Color] -> Put Source #
NFData Color Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods rnf :: Color -> () Source #
Enum Color Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods succ :: Color -> Color Source # pred :: Color -> Color Source # toEnum :: Int -> Color Source # fromEnum :: Color -> Int Source # enumFrom :: Color -> [Color] Source # enumFromThen :: Color -> Color -> [Color] Source # enumFromTo :: Color -> Color -> [Color] Source # enumFromThenTo :: Color -> Color -> Color -> [Color] Source #
Generic Color Source # |

Instance details

Defined in Game.LambdaHack.Definition.Color

Associated Types

type Rep Color |

Instance details

Defined in Game.LambdaHack.Definition.Color

type Rep Color = D1 ('MetaData "Color" "Game.LambdaHack.Definition.Color" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" '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))))))

Methods

from :: Color -> Rep Color x Source #

to :: Rep Color x -> Color Source #

Read Color Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods readsPrec :: Int -> ReadS Color Source # readList :: ReadS [Color] Source # readPrec :: ReadPrec Color Source # readListPrec :: ReadPrec [Color] Source #
Show Color Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods showsPrec :: Int -> Color -> ShowS Source # show :: Color -> String Source # showList :: [Color] -> ShowS Source #
Eq Color Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods (==) :: Color -> Color -> Bool Source # (/=) :: Color -> Color -> Bool Source #
Ord Color Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods compare :: Color -> Color -> Ordering Source # (<) :: Color -> Color -> Bool Source # (<=) :: Color -> Color -> Bool Source # (>) :: Color -> Color -> Bool Source # (>=) :: Color -> Color -> Bool Source # max :: Color -> Color -> Color Source # min :: Color -> Color -> Color Source #
type Rep Color Source # |

Instance details

Defined in Game.LambdaHack.Definition.Color

type Rep Color = D1 ('MetaData "Color" "Game.LambdaHack.Definition.Color" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" '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))))))

defFG :: Color Source #

The default colours, to optimize attribute setting.

isBright :: Color -> Bool Source #

A helper for the terminal frontends that display bright via bold.

darkCol :: [Color] Source #

Colour sets. Sorted.

brightCol :: [Color] Source #

Colour sets. Sorted.

stdCol :: [Color] Source #

Colour sets. Sorted.

legalFgCol :: [Color] Source #

Colour sets. Sorted.

cVeryBadEvent :: Color Source #

cBadEvent :: Color Source #

cRisk :: Color Source #

cGraveRisk :: Color Source #

cVeryGoodEvent :: Color Source #

cGoodEvent :: Color Source #

cVista :: Color Source #

cSleep :: Color Source #

cWakeUp :: Color Source #

cGreed :: Color Source #

cNeutralEvent :: Color Source #

cRareNeutralEvent :: Color Source #

cIdentification :: Color Source #

cMeta :: Color Source #

cBoring :: Color Source #

cGameOver :: Color Source #

cTutorialHint :: Color Source #

colorToRGB :: Color -> Text Source #

Translationg to heavily modified Linux console color RGB values.

Warning: SDL frontend sadly duplicates this code.

# Complete text attributes

data Highlight Source #

Additional map cell highlight, e.g., a colorful square around the cell or a colorful background.

Warning: the highlight underscored by the terminal cursor is the maximal element of this type present on a screen, so don't add new highlights to the end.

Constructors

HighlightNone |
HighlightBackground |
HighlightGreen |
HighlightBlue |
HighlightBrown |
HighlightCyan |
HighlightGrey |
HighlightWhite |
HighlightMagenta |
HighlightRed |
HighlightYellow |
HighlightYellowAim |
HighlightRedAim |
HighlightNoneCursor |

#### Instances

Instances details

Bounded Highlight Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods minBound :: Highlight Source # maxBound :: Highlight Source #
Enum Highlight Source # |

Instance details

Defined in Game.LambdaHack.Definition.Color

Methods

succ :: Highlight -> Highlight Source #

pred :: Highlight -> Highlight Source #

toEnum :: Int -> Highlight Source #

fromEnum :: Highlight -> Int Source #

enumFrom :: Highlight -> [Highlight] Source #

enumFromThen :: Highlight -> Highlight -> [Highlight] Source #

enumFromTo :: Highlight -> Highlight -> [Highlight] Source #

enumFromThenTo :: Highlight -> Highlight -> Highlight -> [Highlight] Source #

Show Highlight Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods showsPrec :: Int -> Highlight -> ShowS Source # show :: Highlight -> String Source # showList :: [Highlight] -> ShowS Source #
Eq Highlight Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods (==) :: Highlight -> Highlight -> Bool Source # (/=) :: Highlight -> Highlight -> Bool Source #
Ord Highlight Source # |

Instance details

Defined in Game.LambdaHack.Definition.Color

Methods

compare :: Highlight -> Highlight -> Ordering Source #

(<) :: Highlight -> Highlight -> Bool Source #

(<=) :: Highlight -> Highlight -> Bool Source #

(>) :: Highlight -> Highlight -> Bool Source #

(>=) :: Highlight -> Highlight -> Bool Source #

max :: Highlight -> Highlight -> Highlight Source #

min :: Highlight -> Highlight -> Highlight Source #

data Attr Source #

Text attributes: foreground color and highlight.

Constructors

Attr |

Fields

- fg :: Color

  foreground colour

- bg :: Highlight

  highlight

#### Instances

Instances details

Show Attr Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods showsPrec :: Int -> Attr -> ShowS Source # show :: Attr -> String Source # showList :: [Attr] -> ShowS Source #
Eq Attr Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods (==) :: Attr -> Attr -> Bool Source # (/=) :: Attr -> Attr -> Bool Source #

highlightToColor :: Highlight -> Color Source #

defAttr :: Attr Source #

The default attribute, to optimize attribute setting.

# Characters with attributes

data AttrChar Source #

Character to display, with its attribute.

Constructors

AttrChar |

Fields

- acAttr :: Attr
- acChar :: Char

#### Instances

Instances details

Show AttrChar Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods showsPrec :: Int -> AttrChar -> ShowS Source # show :: AttrChar -> String Source # showList :: [AttrChar] -> ShowS Source #
Eq AttrChar Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods (==) :: AttrChar -> AttrChar -> Bool Source # (/=) :: AttrChar -> AttrChar -> Bool Source #

newtype AttrCharW32 Source #

Optimized representation of `AttrChar`.

Constructors

AttrCharW32 |

Fields

- attrCharW32 :: Word32

#### Instances

Instances details

UnboxRepClass AttrCharW32 Source # |

Instance details

Defined in Game.LambdaHack.Common.PointArray

Associated Types

type UnboxRep AttrCharW32 |
Instance details Defined in Game.LambdaHack.Common.PointArray type UnboxRep AttrCharW32 = Word32

Methods

toUnboxRepUnsafe :: AttrCharW32 -> UnboxRep AttrCharW32 Source #

fromUnboxRep :: UnboxRep AttrCharW32 -> AttrCharW32 Source #

Binary AttrCharW32 Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods put :: AttrCharW32 -> Put Source # get :: Get AttrCharW32 Source # putList :: [AttrCharW32] -> Put Source #
Enum AttrCharW32 Source # |

Instance details

Defined in Game.LambdaHack.Definition.Color

Methods

succ :: AttrCharW32 -> AttrCharW32 Source #

pred :: AttrCharW32 -> AttrCharW32 Source #

toEnum :: Int -> AttrCharW32 Source #

fromEnum :: AttrCharW32 -> Int Source #

enumFrom :: AttrCharW32 -> [AttrCharW32] Source #

enumFromThen :: AttrCharW32 -> AttrCharW32 -> [AttrCharW32] Source #

enumFromTo :: AttrCharW32 -> AttrCharW32 -> [AttrCharW32] Source #

enumFromThenTo :: AttrCharW32 -> AttrCharW32 -> AttrCharW32 -> [AttrCharW32] Source #

Show AttrCharW32 Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods showsPrec :: Int -> AttrCharW32 -> ShowS Source # show :: AttrCharW32 -> String Source # showList :: [AttrCharW32] -> ShowS Source #
Eq AttrCharW32 Source # |
Instance details Defined in Game.LambdaHack.Definition.Color Methods (==) :: AttrCharW32 -> AttrCharW32 -> Bool Source # (/=) :: AttrCharW32 -> AttrCharW32 -> Bool Source #
Ord AttrCharW32 Source # |

Instance details

Defined in Game.LambdaHack.Definition.Color

Methods

compare :: AttrCharW32 -> AttrCharW32 -> Ordering Source #

(<) :: AttrCharW32 -> AttrCharW32 -> Bool Source #

(<=) :: AttrCharW32 -> AttrCharW32 -> Bool Source #

(>) :: AttrCharW32 -> AttrCharW32 -> Bool Source #

(>=) :: AttrCharW32 -> AttrCharW32 -> Bool Source #

max :: AttrCharW32 -> AttrCharW32 -> AttrCharW32 Source #

min :: AttrCharW32 -> AttrCharW32 -> AttrCharW32 Source #

type UnboxRep AttrCharW32 Source # |
Instance details Defined in Game.LambdaHack.Common.PointArray type UnboxRep AttrCharW32 = Word32

attrCharToW32 :: AttrChar -> AttrCharW32 Source #

attrCharFromW32 :: AttrCharW32 -> AttrChar Source #

fgFromW32 :: AttrCharW32 -> Color Source #

bgFromW32 :: AttrCharW32 -> Highlight Source #

charFromW32 :: AttrCharW32 -> Char Source #

attrFromW32 :: AttrCharW32 -> Attr Source #

spaceAttrW32 :: AttrCharW32 Source #

nbspAttrW32 :: AttrCharW32 Source #

trimmedLineAttrW32 :: AttrCharW32 Source #

attrChar2ToW32 :: Color -> Char -> AttrCharW32 Source #

attrChar1ToW32 :: Char -> AttrCharW32 Source #