packages feed

palette 0.3.0.3 → 0.3.0.4

raw patch · 3 files changed

+17/−7 lines, 3 filesdep ~basedep ~containers

Dependency ranges changed: base, containers

Files

CHANGES.markdown view
@@ -1,8 +1,17 @@+0.3.0.4 (19 Dec 2024)+---------------------++- Allow `base-4.21` and test on GHC 9.12+- Fix warnings+ 0.3.0.3 (10 July 2023) ---------------------  - Allow `base-4.18` (GHC 9.6) - Fix cabal warning++- r1 (31 Jan 2024): allow `base-4.19` (GHC 9.8)+- r2 (18 Sep 2024): allow `base-4.20`, `containers-0.7`, and test on GHC 9.10  0.3.0.2 (22 Feb 2019) ---------------------
palette.cabal view
@@ -1,5 +1,5 @@ Name:                palette-Version:             0.3.0.3+Version:             0.3.0.4 Synopsis:            Utilities for choosing and creating color schemes. Description:         Sets of predefined colors and tools for choosing and                      creating color schemes. Random colors.@@ -15,7 +15,7 @@ Cabal-version:       1.18 Extra-source-files:  README.markdown, diagrams/*.svg Extra-doc-files:     diagrams/*.svg, CHANGES.markdown-Tested-with:         GHC ==8.0.2 || == 8.2.2 || == 8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.5 || ==9.6.1+Tested-with:         GHC ==8.0.2 || == 8.2.2 || == 8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1 || ==9.12.1 Source-repository head   type:     git   location: http://github.com/diagrams/palette.git@@ -28,9 +28,9 @@                        Data.Colour.Palette.Types                        Data.Colour.Palette.RandomColor -  Build-depends:       base >= 4.2 && < 4.19,+  Build-depends:       base >= 4.2 && < 4.22,                        array >= 0.4 && < 0.6,                        colour >= 2.3 && < 3.0,-                       containers >= 0.5 && < 0.7,+                       containers >= 0.5 && < 0.8,                        MonadRandom >= 0.5 && < 0.7   hs-source-dirs:      src
src/Data/Colour/Palette/RandomColor.hs view
@@ -41,6 +41,7 @@ import           Data.Colour.RGBSpace.HSV import           Data.Colour.SRGB            (RGB (..), sRGB) import           Data.List                   (find)+import qualified Data.List.NonEmpty as NE import           Data.Maybe                  (fromMaybe)  getColorDefinition :: Hue -> ColorDefinition@@ -106,9 +107,9 @@ saturationRange hue = result   where     lbs = lowerBounds $ getColorDefinition hue-    result = case lbs of-      [] -> error "Can\'t obtain saturationRange from an empty lowerBounds"-      _  -> (fst . head $ lbs, fst . last $ lbs)+    result = case NE.nonEmpty lbs of+      Nothing -> error "Can\'t obtain saturationRange from an empty lowerBounds"+      Just lbsNE -> (fst . NE.head $ lbsNE, fst . NE.last $ lbsNE)  randomSaturation :: MonadRandom m => Hue -> Luminosity -> m Int randomSaturation HueMonochrome _   = return 0