swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.Game.Entity.Cosmetic

Description

Preserve color fidelity for non-TUI rendering

Synopsis

Documentation

data NamedColor Source #

Instances

Instances details
Show NamedColor Source # 
Instance details

Defined in Swarm.Game.Entity.Cosmetic

type RGBColor = RGB Word8 Source #

8-bit color

namedToTriple :: NamedColor -> RGBColor Source #

Since terminals can customize these named colors using themes or explicit user overrides, these color assignments are somewhat arbitrary.

data TrueColor Source #

High-fidelity color representation for rendering outside of the TUI.

Instances

Instances details
Show TrueColor Source # 
Instance details

Defined in Swarm.Game.Entity.Cosmetic

ToPixel PreservableColor Source # 
Instance details

Defined in Swarm.Game.Entity.Cosmetic

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)

Constructors

FgOnly a 
BgOnly a 
FgAndBg 

Fields

  • a

    foreground

  • a

    background

Instances

Instances details
Functor ColorLayers Source # 
Instance details

Defined in Swarm.Game.Entity.Cosmetic

Methods

fmap :: (a -> b) -> ColorLayers a -> ColorLayers b #

(<$) :: a -> ColorLayers b -> ColorLayers a #

ToPixel PreservableColor Source # 
Instance details

Defined in Swarm.Game.Entity.Cosmetic

Show a => Show (ColorLayers a) Source # 
Instance details

Defined in Swarm.Game.Entity.Cosmetic