colour 2.3.5 → 2.3.6
raw patch · 10 files changed
+49/−37 lines, 10 filesdep +colourdep ~QuickCheckdep ~basePVP ok
version bump matches the API change (PVP)
Dependencies added: colour
Dependency ranges changed: QuickCheck, base
API changes (from Hackage documentation)
Files
- CHANGELOG +6/−0
- Data/Colour.hs +1/−1
- Data/Colour/CIE.hs +1/−1
- Data/Colour/Internal.hs +4/−8
- Data/Colour/Matrix.hs +1/−1
- Data/Colour/RGB.hs +1/−2
- Data/Colour/RGBSpace.hs +2/−5
- Data/Colour/SRGB.hs +2/−2
- Tests.hs +5/−5
- colour.cabal +26/−12
CHANGELOG view
@@ -1,3 +1,9 @@+New in version 2.3.6:+- Minimum base of 4.13.+- Locked down non-colour imports.+- Made semigroup instances canonical.+- Updated dependencies (for testing).+ New in version 2.3.5: - Support for MonadFail Proposal. - Documentation updates.
Data/Colour.hs view
@@ -125,7 +125,7 @@ ) where -import Data.Char+import Data.Char (isAlphaNum, isSpace) import Data.Colour.Internal import qualified Data.Colour.SRGB.Linear import Data.Colour.CIE.Chromaticity (app_prec, infix_prec)
Data/Colour/CIE.hs view
@@ -37,7 +37,7 @@ ) where -import Data.List+import Data.List (foldl1') import Data.Colour import Data.Colour.RGB import Data.Colour.SRGB.Linear
Data/Colour/Internal.hs view
@@ -22,11 +22,9 @@ -} module Data.Colour.Internal where -import Data.List+import Data.List (foldl1') import qualified Data.Colour.Chan as Chan import Data.Colour.Chan (Chan(Chan))-import Data.Monoid-import Data.Semigroup data Red = Red data Green = Green@@ -55,12 +53,11 @@ black = RGB Chan.empty Chan.empty Chan.empty instance (Num a) => Semigroup (Colour a) where- (<>) = mappend+ (RGB r1 g1 b1) <> (RGB r2 g2 b2) =+ RGB (r1 `Chan.add` r2) (g1 `Chan.add` g2) (b1 `Chan.add` b2) instance (Num a) => Monoid (Colour a) where mempty = black- (RGB r1 g1 b1) `mappend` (RGB r2 g2 b2) =- RGB (r1 `Chan.add` r2) (g1 `Chan.add` g2) (b1 `Chan.add` b2) mconcat l = RGB (Chan.sum lr) (Chan.sum lg) (Chan.sum lb) where (lr,lg,lb) = unzip3 (map toRGB l)@@ -173,11 +170,10 @@ -- | 'AlphaColour' forms a monoid with 'over' and 'transparent'. instance (Num a) => Semigroup (AlphaColour a) where- (<>) = mappend+ (<>) = over instance (Num a) => Monoid (AlphaColour a) where mempty = transparent- mappend = over -- | @c1 \`atop\` c2@ returns the 'AlphaColour' produced by covering -- the portion of @c2@ visible by @c1@.
Data/Colour/Matrix.hs view
@@ -22,7 +22,7 @@ -} module Data.Colour.Matrix where -import Data.List+import Data.List (transpose) default (Rational)
Data/Colour/RGB.hs view
@@ -22,10 +22,9 @@ -} module Data.Colour.RGB where -import Data.List+import Data.List (elemIndex, transpose) import Data.Colour.Matrix import Data.Colour.CIE.Chromaticity-import Control.Applicative -- |An RGB triple for an unspecified colour space. data RGB a = RGB {channelRed :: !a
Data/Colour/RGBSpace.hs view
@@ -46,8 +46,6 @@ ) where -import Data.Monoid-import Data.Semigroup import Data.Colour.CIE.Chromaticity import Data.Colour.Matrix import Data.Colour.RGB@@ -111,12 +109,11 @@ TransferFunction rev for (recip g) instance (Num a) => Semigroup (TransferFunction a) where- (<>) = mappend+ (TransferFunction f0 f1 f) <> (TransferFunction g0 g1 g) =+ (TransferFunction (f0 . g0) (g1 . f1) (f*g)) instance (Num a) => Monoid (TransferFunction a) where mempty = linearTransferFunction- (TransferFunction f0 f1 f) `mappend` (TransferFunction g0 g1 g) =- (TransferFunction (f0 . g0) (g1 . f1) (f*g)) -- |An 'RGBSpace' is a colour coordinate system for colours laying -- 'inGamut' of 'gamut'.
Data/Colour/SRGB.hs view
@@ -33,8 +33,8 @@ ) where -import Data.Word-import Numeric+import Data.Word (Word8)+import Numeric (readHex, showHex) import Data.Colour.Internal (quantize) import Data.Colour.SRGB.Linear import Data.Colour.RGBSpace hiding (transferFunction)
Tests.hs view
@@ -23,13 +23,13 @@ -} module Main where -import System.Random-import Data.Word-import Control.Monad-import Test.QuickCheck+import Data.Word (Word8)+import Control.Monad (liftM, liftM2, liftM3)+import Test.QuickCheck ( Arbitrary, CoArbitrary, Gen, Property+ , (==>), arbitrary, choose, coarbitrary, forAll+ ) import Test.Framework (defaultMain, defaultMainWithOpts, testGroup) import Test.Framework.Providers.QuickCheck2 (testProperty)-import Data.Monoid import Data.Colour.Matrix import Data.Colour
colour.cabal view
@@ -1,5 +1,5 @@ Name: colour-Version: 2.3.5+Version: 2.3.6 Cabal-Version: >= 1.10 License: MIT License-file: LICENSE@@ -13,12 +13,12 @@ Colours can be blended and composed. Various colour spaces are supported. A module of colour names ("Data.Colour.Names") is provided.-Tested-with: GHC == 8.6.4+Tested-with: GHC == 8.8.4 data-files: README CHANGELOG Library default-language: Haskell98- Build-Depends: base >= 4.9 && < 5+ Build-Depends: base >= 4.13 && < 5 Exposed-Modules: Data.Colour Data.Colour.SRGB Data.Colour.SRGB.Linear@@ -34,12 +34,26 @@ Data.Colour.Matrix Data.Colour.CIE.Chromaticity test-suite test-colour- default-language: Haskell98- type: exitcode-stdio-1.0- main-is: Tests.hs- build-depends: base >= 4.9 && < 5,- QuickCheck >= 2.5 && < 2.14,- random >= 1.0 && < 1.2,- test-framework >= 0.8 && < 0.9,- test-framework-quickcheck2 >= 0.3 && < 0.4-+ default-language: Haskell98+ type: exitcode-stdio-1.0+ main-is: Tests.hs+ build-depends: base >= 4.13 && < 5,+ colour,+ QuickCheck >= 2.5 && < 2.15,+ random >= 1.0 && < 1.2,+ test-framework >= 0.8 && < 0.9,+ test-framework-quickcheck2 >= 0.3 && < 0.4+ Other-Modules: Data.Colour+ Data.Colour.SRGB+ Data.Colour.SRGB.Linear+ Data.Colour.CIE+ Data.Colour.CIE.Illuminant+ Data.Colour.RGBSpace+ Data.Colour.RGBSpace.HSL+ Data.Colour.RGBSpace.HSV+ Data.Colour.Names+ Data.Colour.Internal+ Data.Colour.Chan+ Data.Colour.RGB+ Data.Colour.Matrix+ Data.Colour.CIE.Chromaticity