| License | BSD-3-Clause |
|---|---|
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Swarm.Game.Entity.Cosmetic
Description
Preserve color fidelity for non-TUI rendering
Synopsis
- data NamedColor
- type RGBColor = RGB Word8
- data TrueColor
- data ColorLayers a
- type PreservableColor = ColorLayers TrueColor
- getBackground :: ColorLayers a -> Maybe a
- flattenBg :: ColorLayers a -> a
- newtype WorldAttr = WorldAttr String
Documentation
data NamedColor Source #
Instances
| Show NamedColor Source # | |
Defined in Swarm.Game.Entity.Cosmetic Methods showsPrec :: Int -> NamedColor -> ShowS # show :: NamedColor -> String # showList :: [NamedColor] -> ShowS # | |
High-fidelity color representation for rendering outside of the TUI.
Constructors
| AnsiColor NamedColor | |
| Triple RGBColor |
data ColorLayers a Source #
A value of type ColorLayers a represents the assignment of
foreground and/or background color to an Entity or terrain,
where a may be a medium-independent (i.e. "authoritative") color
representation, or medium-specific (e.g. a vty color).
The Functor instance facilitates easy conversion from the
authoritative color to the specialized representation.
Ignores vty "styles", such as bold/italic/underline.
This is intended to facilitate multiple rendering mediums:
- Single pixel per world cell (one color must be chosen between foreground and background, if both are specified)
- Pixel block per world cell (can show two colors in some stylized manner)
- Glyph per world cell (can render a colored display character on a colored background)
Instances
| Functor ColorLayers Source # | |
Defined in Swarm.Game.Entity.Cosmetic Methods fmap :: (a -> b) -> ColorLayers a -> ColorLayers b # (<$) :: a -> ColorLayers b -> ColorLayers a # | |
| Show a => Show (ColorLayers a) Source # | |
Defined in Swarm.Game.Entity.Cosmetic Methods showsPrec :: Int -> ColorLayers a -> ShowS # show :: ColorLayers a -> String # showList :: [ColorLayers a] -> ShowS # | |
type PreservableColor = ColorLayers TrueColor Source #
getBackground :: ColorLayers a -> Maybe a Source #
flattenBg :: ColorLayers a -> a Source #
Instances
| Show WorldAttr Source # | |
| Eq WorldAttr Source # | |
| Ord WorldAttr Source # | |