rainbow 0.16.2.0 → 0.18.0.0
raw patch · 3 files changed
+19/−13 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Rainbow.Colors: newtype Both
+ Rainbow: Both :: Color8 -> Maybe Color256 -> Both
+ Rainbow: both256 :: Both -> Maybe Color256
+ Rainbow: both8 :: Both -> Color8
+ Rainbow.Colors: both256 :: Both -> Maybe Color256
+ Rainbow.Colors: both8 :: Both -> Color8
+ Rainbow.Colors: data Both
- Rainbow.Colors: Both :: Color8 -> Both
+ Rainbow.Colors: Both :: Color8 -> Maybe Color256 -> Both
Files
- lib/Rainbow.hs +6/−6
- lib/Rainbow/Colors.hs +11/−5
- rainbow.cabal +2/−2
lib/Rainbow.hs view
@@ -55,14 +55,14 @@ -- @ -- import Data.Word ('Data.Word.Word8') -- 'putChunkLn' $ "Pink on 256-color terminal only"--- <> (201 :: 'Data.Word.Word8')+-- <> 'fore' (201 :: 'Data.Word.Word8') -- @ -- -- If 'mappend' multiple chunks that change the same property, the -- rightmost one \"wins\": -- -- @--- 'putChunkLn' $ "This will be blue" <> 'red' <> 'blue'+-- 'putChunkLn' $ "This will be blue" <> 'fore' 'red' <> 'fore' 'blue' -- @ -- -- This property comes in handy if you want to specify a default color@@ -71,16 +71,16 @@ -- -- @ -- 'putChunkLn' $ "Red on 8-color, pink on 256-color"--- <> 'red' <> (201 :: 'Data.Word.Word8')+-- <> 'fore' 'red' <> 'fore' (201 :: 'Data.Word.Word8') -- @ -- -- However, if you use 'mappend' to add additional 'Chunk's that have -- text, the text will be appended: -- -- @--- 'putChunkLn' $ 'green' <> "You will see this text "+-- 'putChunkLn' $ 'fore' 'green' <> "You will see this text " -- <> "and this text too, but it will all be blue"--- <> 'blue'+-- <> 'fore' 'blue' -- @ -- -- Although one chunk can have different colors on 8- and 256-color@@ -175,7 +175,7 @@ , Color(..) -- ** Colors for both 8- and 256-color terminals- , Both+ , Both(..) , black , red , green
lib/Rainbow/Colors.hs view
@@ -4,6 +4,7 @@ -- "Rainbow" does not re-export. module Rainbow.Colors where +import Data.Maybe (fromMaybe) import Rainbow.Types import Data.Monoid import Data.Word (Word8)@@ -76,11 +77,14 @@ -- | Things of type 'Both' affect both 8- and 256-color terminals. -- (They do /not/ affect both the foreground and background.)-newtype Both = Both Color8- deriving (Eq, Ord, Show)+data Both = Both+ { both8 :: Color8+ , both256 :: Maybe Color256+ -- ^ If 'Nothing', use the 'both8' color on 256-color terminals.+ } deriving (Eq, Ord, Show) both :: Color8 -> Both-both = Both+both c8 = Both c8 Nothing black :: Both black = both black8@@ -158,8 +162,10 @@ -- | Affects the foreground and background of both 8- and 256-color -- terminals. instance Color Both where- fore (Both c) = fore c <> fore (to256 c)- back (Both c) = back c <> back (to256 c)+ fore (Both c8 mc256) = fore c8+ <> fore (fromMaybe (to256 c8) mc256)+ back (Both c8 mc256) = back c8+ <> back (fromMaybe (to256 c8) mc256) -- | Affects the foreground and background of 8-color terminals. instance Color Enum8 where
rainbow.cabal view
@@ -3,10 +3,10 @@ -- http://www.github.com/massysett/cartel -- -- Script name used to generate: genCabal.hs--- Generated on: 2014-08-14 14:19:53.263492 EDT+-- Generated on: 2014-10-27 11:08:35.892513 EDT -- Cartel library version: 0.10.0.2 name: rainbow-version: 0.16.2.0+version: 0.18.0.0 cabal-version: >= 1.14 build-type: Simple license: BSD3