-- | PS graphics state.
module Graphics.PS.GS (GS(..)
                      ,LineCap(..)
                      ,LineJoin(..)
                      ,LineWidth
                      ,Color(..)
                      ,defaultGS, greyGS) where

-- | Line cap enumeration.
data LineCap = ButtCap
             | RoundCap
             | ProjectingSquareCap
               deriving (Eq, Show, Enum)

-- | Line width (real).
type LineWidth = Double

-- | Line join enumeration.
data LineJoin = MiterJoin
              | RoundJoin
              | BevelJoin
                deriving (Eq, Show, Enum)

-- | Colour model.
data Color = RGB Double Double Double
             deriving (Eq, Show)

-- | Graphics state.
data GS = GS Color LineWidth LineCap LineJoin ([Int], Int) Double
          deriving (Eq, Show)

-- | Default 'GS' of indicated 'Color'.
defaultGS :: Color -> GS
defaultGS c = GS c 1.0 ButtCap MiterJoin ([], 0) 10.0

-- | Default 'GS' of indicated shade of grey.
greyGS :: Double -> GS
greyGS g = defaultGS (RGB g g g)

{--
blackGS :: GS
blackGS = greyGS 0
--}