ansi-terminal-game

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit eed3c4ea8c22f4c1bf20c7cf2699f5e3377ef3d6
parent bc8cbc6ed5e7396cc99741937269204d0aff7c27
Author: Francesco Ariis <fa-ml@ariis.it>
Date:   Thu, 22 Dec 2022 14:05:10 +0100

Qualify imports

Diffstat:
Msrc/Terminal/Game.hs | 4++--
Msrc/Terminal/Game/Draw.hs | 12++++++------
Msrc/Terminal/Game/Plane.hs | 22+++++++++++-----------
3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/Terminal/Game.hs b/src/Terminal/Game.hs @@ -103,7 +103,7 @@ module Terminal.Game ( -- * Running -- Non-standard colors rgbColor, paletteColor, - sRGB24, sRGBBounded, sRGB, sRGB24read, + S.sRGB24, S.sRGBBounded, S.sRGB, S.sRGB24read, xterm6LevelRGB, xterm24LevelGray, xtermSystem, -- *** Alternative origins @@ -147,9 +147,9 @@ import Terminal.Game.Layer.Object as O import Terminal.Game.Plane import Terminal.Game.Random import Text.LineBreak -import Data.Colour.SRGB ( sRGB24, sRGBBounded, sRGB, sRGB24read ) import qualified Control.Monad as CM +import qualified Data.Colour.SRGB as S -- $origins -- Placing a plane is sometimes more convenient if the coordinates origin diff --git a/src/Terminal/Game/Draw.hs b/src/Terminal/Game/Draw.hs @@ -14,12 +14,12 @@ import Terminal.Game.Plane import Text.LineBreak -import qualified Data.Function as F ( (&) ) -import qualified Data.List as L +import qualified Data.Colour.RGBSpace as S +import qualified Data.Function as F ( (&) ) +import qualified Data.List as L +import qualified Data.Word as W import qualified System.Console.ANSI as CA -import Data.Word ( Word8 ) -import Data.Colour.RGBSpace ( Colour ) ----------- -- TYPES -- @@ -131,11 +131,11 @@ invert :: Plane -> Plane invert p = mapPlane reverseCell p -- | Set RGB color -rgbColor :: Colour Float -> Plane -> Plane +rgbColor :: S.Colour Float -> Plane -> Plane rgbColor k p = mapPlane (rgbColorCell k) p -- | Set Palette color -paletteColor :: Word8 -> Plane -> Plane +paletteColor :: W.Word8 -> Plane -> Plane paletteColor k p = mapPlane (paletteColorCell k) p diff --git a/src/Terminal/Game/Plane.hs b/src/Terminal/Game/Plane.hs @@ -11,15 +11,15 @@ module Terminal.Game.Plane where import Terminal.Game.Character -import qualified Data.Array as A -import qualified Data.Bifunctor as B -import qualified Data.List.Split as LS -import qualified Data.Tuple as T -import qualified GHC.Generics as G +import qualified Data.Array as A +import qualified Data.Bifunctor as B +import qualified Data.Colour.RGBSpace as S +import qualified Data.List.Split as LS +import qualified Data.Tuple as T +import qualified Data.Word as W +import qualified GHC.Generics as G import qualified System.Console.ANSI as CA -import Data.Word ( Word8 ) -import Data.Colour.RGBSpace ( Colour ) ---------------- -- DATA TYPES -- @@ -42,8 +42,8 @@ type Bold = Bool type Reversed = Bool data ColorInfo = ANSIColorInfo (CA.Color, CA.ColorIntensity) - | RGBColorInfo (Colour Float) - | PaletteColorInfo Word8 + | RGBColorInfo (S.Colour Float) + | PaletteColorInfo W.Word8 deriving (Show, Eq) -- can be an ASCIIChar or a special, transparent character @@ -97,11 +97,11 @@ colorCell :: CA.Color -> CA.ColorIntensity -> Cell -> Cell colorCell k i (CellChar c b r _) = CellChar c b r (Just $ ANSIColorInfo (k, i)) colorCell _ _ Transparent = Transparent -rgbColorCell :: Colour Float -> Cell -> Cell +rgbColorCell :: S.Colour Float -> Cell -> Cell rgbColorCell k (CellChar c b r _) = CellChar c b r (Just $ RGBColorInfo k) rgbColorCell _ Transparent = Transparent -paletteColorCell :: Word8 -> Cell -> Cell +paletteColorCell :: W.Word8 -> Cell -> Cell paletteColorCell k (CellChar c b r _) = CellChar c b r (Just $ PaletteColorInfo k) paletteColorCell _ Transparent = Transparent