diff --git a/haddock.txt b/haddock.txt index aad0408..462ffa1 100644 --- a/haddock.txt +++ b/haddock.txt @@ -1,10 +1,7 @@ 100% ( 22 / 22) in 'Reanimate.Effect' - 100% ( 17 / 17) in 'Reanimate.Parameters' - 100% ( 13 / 13) in 'Reanimate.ColorMap' - 100% ( 12 / 12) in 'Reanimate.ColorComponents' - 100% ( 9 / 9) in 'Reanimate.Constants' - 94% (144 /154) in 'Reanimate' + 92% ( 12 / 13) in 'Reanimate.ColorMap' 88% ( 7 / 8) in 'Reanimate.Transition' + 86% (134 /155) in 'Reanimate' 85% ( 47 / 55) in 'Reanimate.Svg.Constructors' 77% ( 33 / 43) in 'Reanimate.Animation' 73% ( 8 / 11) in 'Reanimate.Ease' @@ -14,9 +11,9 @@ 50% ( 1 / 2) in 'Reanimate.Builtin.CirclePlot' 44% ( 4 / 9) in 'Reanimate.LaTeX' 42% ( 17 / 40) in 'Reanimate.GeoProjection' + 42% ( 5 / 12) in 'Reanimate.ColorComponents' 41% ( 45 /111) in 'Reanimate.Scene' 38% ( 3 / 8) in 'Reanimate.Builtin.Documentation' - 33% ( 4 / 12) in 'Reanimate.Render' 28% ( 5 / 18) in 'Reanimate.Svg' 25% ( 1 / 4) in 'Reanimate.Builtin.Slide' 17% ( 1 / 6) in 'Reanimate.Svg.BoundingBox' @@ -29,13 +26,16 @@ 0% ( 0 / 37) in 'Reanimate.Internal.CubicBezier' 0% ( 0 / 20) in 'Reanimate.Math.Compatible' 0% ( 0 / 19) in 'Reanimate.Morph.Rigid' + 0% ( 0 / 17) in 'Reanimate.Parameters' 0% ( 0 / 13) in 'Reanimate.Morph.LeastWork' 0% ( 0 / 13) in 'Reanimate.Morph.Common' + 0% ( 0 / 12) in 'Reanimate.Render' 0% ( 0 / 10) in 'Reanimate.Math.Render' 0% ( 0 / 10) in 'Reanimate.ColorSpace' 0% ( 0 / 10) in 'Reanimate.Builtin.TernaryPlot' 0% ( 0 / 9) in 'Reanimate.Povray' 0% ( 0 / 9) in 'Reanimate.Math.Smooth' + 0% ( 0 / 9) in 'Reanimate.Constants' 0% ( 0 / 8) in 'Reanimate.Misc' 0% ( 0 / 8) in 'Reanimate.Math.Balloon' 0% ( 0 / 8) in 'Reanimate.Chiphunk' diff --git a/haddock_badge.json b/haddock_badge.json index 0e2504c..89b158d 100644 --- a/haddock_badge.json +++ b/haddock_badge.json @@ -1 +1 @@ - { "schemaVersion": 1, "label": "api docs", "message": "34%", "color": "success" } + { "schemaVersion": 1, "label": "api docs", "message": "30%", "color": "success" } diff --git a/reanimate-0.4.1.0-inplace/Reanimate.ColorComponents.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.ColorComponents.hs.html index 3256f3c..26a2a86 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.ColorComponents.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.ColorComponents.hs.html @@ -18,134 +18,104 @@ span.spaces { background: white }
     1 {-# LANGUAGE RecordWildCards #-}
-    2 {- |
-    3   Colors are three dimensional and can be projected into many color spaces
-    4   with different properties.
-    5 
-    6   Interpolating directly in the RGB color space is unintuitive and rarely useful.
-    7   If you want to transition through color, you most likely want either the XYZ space
-    8   (for physically accurate color transitions) or the LAB space (for esthetically
-    9   pleasing colors).
-   10 -}
-   11 module Reanimate.ColorComponents
-   12   ( ColorComponents(..)
-   13   , rgbComponents
-   14   , hsvComponents
-   15   , labComponents
-   16   , xyzComponents
-   17   , lchComponents
-   18   , interpolate
-   19   , interpolateRGB8
-   20   , interpolateRGBA8
-   21   , toRGB8
-   22   , fromRGB8
-   23   ) where
-   24 
-   25 import           Codec.Picture
-   26 import           Codec.Picture.Types
-   27 import           Data.Colour
-   28 import           Data.Colour.CIE
-   29 import           Data.Colour.CIE.Illuminant (d65)
-   30 import           Data.Colour.RGBSpace
-   31 import           Data.Colour.RGBSpace.HSV
-   32 import           Data.Colour.SRGB
-   33 import           Data.Fixed
-   34 import           Reanimate.Ease
-   35 
-   36 -- | Constructor and destructor for color's three components.
-   37 data ColorComponents = ColorComponents
-   38   { colorUnpack :: Colour Double -> (Double, Double, Double)
-   39     -- ^ Unpack a color into its three components.
-   40   , colorPack   :: Double -> Double -> Double -> Colour Double
-   41     -- ^ Restore a color from three coordinates.
-   42   }
-   43 
-   44 -- | > interpolate rgbComponents yellow blue
-   45 --
-   46 --   <<docs/gifs/doc_rgbComponents.gif>>
-   47 rgbComponents :: ColorComponents
-   48 rgbComponents = ColorComponents rgbUnpack sRGB
-   49   where
-   50     rgbUnpack :: Colour Double -> (Double, Double, Double)
-   51     rgbUnpack c =
-   52       case toSRGB c of
-   53         RGB r g b -> (r,g,b)
-   54 
-   55 -- | > interpolate hsvComponents yellow blue
-   56 --
-   57 --   <<docs/gifs/doc_hsvComponents.gif>>
-   58 hsvComponents :: ColorComponents
-   59 hsvComponents = ColorComponents unpack pack
-   60   where
-   61     unpack = hsvView.toSRGB
-   62     pack a b c = uncurryRGB sRGB $ hsv a b c
-   63 
-   64 -- | > interpolate labComponents yellow blue
-   65 --
-   66 --   <<docs/gifs/doc_labComponents.gif>>
-   67 labComponents :: ColorComponents
-   68 labComponents = ColorComponents unpack pack
-   69   where
-   70     unpack = cieLABView d65
-   71     pack = cieLAB d65
-   72 
-   73 -- | > interpolate xyzComponents yellow blue
-   74 --
-   75 --   <<docs/gifs/doc_xyzComponents.gif>>
-   76 xyzComponents :: ColorComponents
-   77 xyzComponents = ColorComponents cieXYZView cieXYZ
-   78 
-   79 -- | > interpolate lchComponents yellow blue
-   80 --
-   81 --   <<docs/gifs/doc_lchComponents.gif>>
-   82 lchComponents :: ColorComponents
-   83 lchComponents = ColorComponents unpack pack
-   84   where
-   85     toDeg,toRad :: Double -> Double
-   86     toRad deg = deg/180 * pi
-   87     toDeg rad = rad/pi * 180
-   88     unpack :: Colour Double -> (Double, Double, Double)
-   89     unpack color =
-   90       let (l,a,b) = cieLABView d65 color
-   91           c = sqrt (a*a + b*b)
-   92           h :: Double
-   93           h = (toDeg(atan2 b a) + 360) `mod'` 360
-   94           isZero = round (c*10000) == (0::Integer)
-   95       in (l, c, if isZero then 0/0 else h)
-   96     pack l c h =
-   97       cieLAB d65 l (cos (toRad h) * c) (sin (toRad h) * c)
-   98 
-   99 -- | Smoothly interpolate between two colors using the given color components.
-  100 interpolate :: ColorComponents -> Colour Double -> Colour Double -> (Double -> Colour Double)
-  101 interpolate ColorComponents{..} from to = \d ->
-  102     colorPack (a1 + (a2-a1)*d) (b1 + (b2-b1)*d) (c1 + (c2-c1)*d)
-  103   where
-  104     (a1,b1,c1) = colorUnpack from
-  105     (a2,b2,c2) = colorUnpack to
-  106 
-  107 -- | Convenience interpolation function for RGB8 values.
-  108 interpolateRGB8 :: ColorComponents -> PixelRGB8 -> PixelRGB8 -> (Double -> PixelRGB8)
-  109 interpolateRGB8 comps from to = toRGB8 . interpolate comps (fromRGB8 from) (fromRGB8 to)
-  110 
-  111 -- | Convenience interpolation function for RGBA8 values.
-  112 interpolateRGBA8 :: ColorComponents -> PixelRGBA8 -> PixelRGBA8 -> (Double -> PixelRGBA8)
-  113 interpolateRGBA8 comps from to = \t ->
-  114   case interp t of
-  115     PixelRGB8 r g b ->
-  116       let alpha = fromToS (fromIntegral $ pixelOpacity from) (fromIntegral $ pixelOpacity to) t
-  117       in PixelRGBA8 r g b (round alpha)
-  118   where
-  119     interp = interpolateRGB8 comps (dropTransparency from) (dropTransparency to)
-  120 
-  121 -- | Convenience function for expressing a color as an RGB8 value.
-  122 toRGB8 :: Colour Double -> PixelRGB8
-  123 toRGB8 c = PixelRGB8 r g b
-  124   where
-  125     RGB r g b = toSRGBBounded c
-  126 
-  127 -- | Convenience function for expressing an RGB8 value as a color.
-  128 fromRGB8 :: PixelRGB8 -> Colour Double
-  129 fromRGB8 (PixelRGB8 r g b) = sRGB24 r g b
+    2 module Reanimate.ColorComponents where
+    3 
+    4 import           Codec.Picture
+    5 import           Codec.Picture.Types
+    6 import           Data.Colour
+    7 import           Data.Colour.CIE
+    8 import           Data.Colour.CIE.Illuminant (d65)
+    9 import           Data.Colour.RGBSpace
+   10 import           Data.Colour.RGBSpace.HSV
+   11 import           Data.Colour.SRGB
+   12 import           Data.Fixed
+   13 import           Reanimate.Ease
+   14 
+   15 data ColorComponents = ColorComponents
+   16   { colorUnpack :: Colour Double -> (Double, Double, Double)
+   17   , colorPack   :: Double -> Double -> Double -> Colour Double }
+   18 
+   19 -- | > interpolate rgbComponents yellow blue
+   20 --
+   21 --   <<docs/gifs/doc_rgbComponents.gif>>
+   22 rgbComponents :: ColorComponents
+   23 rgbComponents = ColorComponents rgbUnpack sRGB
+   24   where
+   25     rgbUnpack :: Colour Double -> (Double, Double, Double)
+   26     rgbUnpack c =
+   27       case toSRGB c of
+   28         RGB r g b -> (r,g,b)
+   29 
+   30 -- | > interpolate hsvComponents yellow blue
+   31 --
+   32 --   <<docs/gifs/doc_hsvComponents.gif>>
+   33 hsvComponents :: ColorComponents
+   34 hsvComponents = ColorComponents unpack pack
+   35   where
+   36     unpack = hsvView.toSRGB
+   37     pack a b c = uncurryRGB sRGB $ hsv a b c
+   38 
+   39 -- | > interpolate labComponents yellow blue
+   40 --
+   41 --   <<docs/gifs/doc_labComponents.gif>>
+   42 labComponents :: ColorComponents
+   43 labComponents = ColorComponents unpack pack
+   44   where
+   45     unpack = cieLABView d65
+   46     pack = cieLAB d65
+   47 
+   48 -- | > interpolate xyzComponents yellow blue
+   49 --
+   50 --   <<docs/gifs/doc_xyzComponents.gif>>
+   51 xyzComponents :: ColorComponents
+   52 xyzComponents = ColorComponents cieXYZView cieXYZ
+   53 
+   54 -- | > interpolate lchComponents yellow blue
+   55 --
+   56 --   <<docs/gifs/doc_lchComponents.gif>>
+   57 lchComponents :: ColorComponents
+   58 lchComponents = ColorComponents unpack pack
+   59   where
+   60     toDeg,toRad :: Double -> Double
+   61     toRad deg = deg/180 * pi
+   62     toDeg rad = rad/pi * 180
+   63     unpack :: Colour Double -> (Double, Double, Double)
+   64     unpack color =
+   65       let (l,a,b) = cieLABView d65 color
+   66           c = sqrt (a*a + b*b)
+   67           h :: Double
+   68           h = (toDeg(atan2 b a) + 360) `mod'` 360
+   69           isZero = round (c*10000) == (0::Integer)
+   70       in (l, c, if isZero then 0/0 else h)
+   71     pack l c h =
+   72       cieLAB d65 l (cos (toRad h) * c) (sin (toRad h) * c)
+   73 
+   74 interpolate :: ColorComponents -> Colour Double -> Colour Double -> (Double -> Colour Double)
+   75 interpolate ColorComponents{..} from to = \d ->
+   76     colorPack (a1 + (a2-a1)*d) (b1 + (b2-b1)*d) (c1 + (c2-c1)*d)
+   77   where
+   78     (a1,b1,c1) = colorUnpack from
+   79     (a2,b2,c2) = colorUnpack to
+   80 
+   81 interpolateRGB8 :: ColorComponents -> PixelRGB8 -> PixelRGB8 -> (Double -> PixelRGB8)
+   82 interpolateRGB8 comps from to = toRGB8 . interpolate comps (fromRGB8 from) (fromRGB8 to)
+   83 
+   84 interpolateRGBA8 :: ColorComponents -> PixelRGBA8 -> PixelRGBA8 -> (Double -> PixelRGBA8)
+   85 interpolateRGBA8 comps from to = \t ->
+   86   case interp t of
+   87     PixelRGB8 r g b ->
+   88       let alpha = fromToS (fromIntegral $ pixelOpacity from) (fromIntegral $ pixelOpacity to) t
+   89       in PixelRGBA8 r g b (round alpha)
+   90   where
+   91     interp = interpolateRGB8 comps (dropTransparency from) (dropTransparency to)
+   92 
+   93 toRGB8 :: Colour Double -> PixelRGB8
+   94 toRGB8 c = PixelRGB8 r g b
+   95   where
+   96     RGB r g b = toSRGBBounded c
+   97 
+   98 fromRGB8 :: PixelRGB8 -> Colour Double
+   99 fromRGB8 (PixelRGB8 r g b) = sRGB24 r g b
 
 
diff --git a/reanimate-0.4.1.0-inplace/Reanimate.ColorMap.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.ColorMap.hs.html index bd99486..7d35bc6 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.ColorMap.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.ColorMap.hs.html @@ -18,515 +18,510 @@ span.spaces { background: white }
     1 {-# LANGUAGE OverloadedStrings #-}
-    2 {-|
-    3   A colormap takes a number between 0 and 1 (inclusive) and spits out a color.
-    4   The colors do not have an alpha component but one can be added with
-    5   `Codec.Picture.Types.promotePixel`.
-    6 -}
-    7 module Reanimate.ColorMap
-    8   ( turbo
-    9   , viridis
-   10   , magma
-   11   , inferno
-   12   , plasma
-   13   , sinebow
-   14   , parula
-   15   , cividis
-   16   , jet
-   17   , hsv
-   18   , hsvMatlab
-   19   , greyscale
-   20   ) where
-   21 
-   22 import Data.Text (Text)
-   23 import Data.Vector (Vector)
-   24 import qualified Data.Text as T
-   25 import qualified Data.Vector as V
-   26 import Codec.Picture
-   27 import Data.Char
-   28 import Data.Bits
-   29 import qualified Data.Colour.RGBSpace.HSV as HSV
-   30 import           Data.Colour.RGBSpace
-   31 
-   32 -- | Given a number t in the range [0,1], returns the corresponding color from
-   33 --   the “turbo” color scheme by Anton Mikhailov.
-   34 --
-   35 --   <<docs/gifs/doc_turbo.gif>>
-   36 turbo :: Double -> PixelRGB8
-   37 turbo t = PixelRGB8 red green blue
-   38   where
-   39     red   = trunc (round (34.61 + t * (1172.33 - t * (10793.56 - t * (33300.12 - t * (38394.49 - t * 14825.05))))))
-   40     green = trunc (round (23.31 + t * (557.33 + t * (1225.33 - t * (3574.96 - t * (1073.77 + t * 707.56))))))
-   41     blue  = trunc (round (27.2 + t * (3211.1 - t * (15327.97 - t * (27814 - t * (22569.18 - t * 6838.66))))))
-   42     trunc :: Integer -> Pixel8
-   43     trunc = fromIntegral . min 255 . max 0
-   44 
-   45 -- | Given a number t in the range [0,1], returns the corresponding color from
-   46 --   the “viridis” perceptually-uniform color scheme designed by van der Walt,
-   47 --   Smith and Firing for matplotlib, represented as an RGB string.
-   48 --
-   49 --   <<docs/gifs/doc_viridis.gif>>
-   50 viridis :: Double -> PixelRGB8
-   51 viridis = ramp (colors
-   52   "44015444025645045745055946075a46085c460a5d460b5e470d60470e614710634711644713\
-   53   \6548146748166848176948186a481a6c481b6d481c6e481d6f481f7048207148217348237448\
-   54   \2475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f\
-   55   \463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142\
-   56   \874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b\
-   57   \518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d\
-   58   \355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b\
-   59   \8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a\
-   60   \778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e\
-   61   \25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f\
-   62   \8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e\
-   63   \9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a685\
-   64   \22a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db2\
-   65   \7d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340\
-   66   \bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c765\
-   67   \5ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d0\
-   68   \5477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195\
-   69   \d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2b\
-   70   \b8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e2\
-   71   \19dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8\
-   72   \e621fbe723fde725")
-   73 
-   74 -- | Given a number t in the range [0,1], returns the corresponding color from
-   75 --   the “magma” perceptually-uniform color scheme designed by van der Walt and
-   76 --   Smith for matplotlib, represented as an RGB string.
-   77 --
-   78 --   <<docs/gifs/doc_magma.gif>>
-   79 magma :: Double -> PixelRGB8
-   80 magma = ramp (colors
-   81   "00000401000501010601010802010902020b02020d03030f0303120404140504160605180605\
-   82   \1a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d3414\
-   83   \0e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e221150241253\
-   84   \25125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f\
-   85   \6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f\
-   86   \127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980\
-   87   \641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621\
-   88   \817822817922827b23827c23827e24828025828125818326818426818627818827818928818b\
-   89   \29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7f\
-   90   \a02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb336\
-   91   \7ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c8\
-   92   \3e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476a\
-   93   \dc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb57\
-   94   \60ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf6\
-   95   \6c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835f\
-   96   \fb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b\
-   97   \6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afe\
-   98   \b47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8d\
-   99   \fecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2\
-  100   \a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fc\
-  101   \f9bbfcfbbdfcfdbf")
-  102 
-  103 -- | Given a number t in the range [0,1], returns the corresponding color from
-  104 --   the “inferno” perceptually-uniform color scheme designed by van der Walt
-  105 --   and Smith for matplotlib, represented as an RGB string.
-  106 --
-  107 --   <<docs/gifs/doc_inferno.gif>>
-  108 inferno :: Double -> PixelRGB8
-  109 inferno = ramp (colors
-  110   "00000401000501010601010802010a02020c02020e0302100403120403140504170604190705\
-  111   \1b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b3716\
-  112   \0b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b55\
-  113   \2b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a\
-  114   \67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d55\
-  115   \0f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e\
-  116   \6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e\
-  117   \6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f246990256892\
-  118   \25689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60\
-  119   \a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b935\
-  120   \56ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb\
-  121   \4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3c\
-  122   \db503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee860\
-  123   \2de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2\
-  124   \741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890c\
-  125   \f98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca1\
-  126   \08fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfb\
-  127   \ba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13d\
-  128   \f7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea\
-  129   \69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9\
-  130   \fc9dfafda1fcffa4")
-  131 
-  132 -- | Given a number t in the range [0,1], returns the corresponding color from
-  133 --   the “plasma” perceptually-uniform color scheme designed by van der Walt and
-  134 --   Smith for matplotlib, represented as an RGB string.
-  135 --
-  136 --   <<docs/gifs/doc_plasma.gif>>
-  137 plasma :: Double -> PixelRGB8
-  138 plasma = ramp (colors
-  139   "0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05\
-  140   \932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41\
-  141   \049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a4\
-  142   \5601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900\
-  143   \a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d\
-  144   \03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca4\
-  145   \8f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a\
-  146   \9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b0\
-  147   \2991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786\
-  148   \be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca45\
-  149   \7acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5\
-  150   \546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263\
-  151   \e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e971\
-  152   \58e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1\
-  153   \814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143\
-  154   \f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca3\
-  155   \38fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efe\
-  156   \b72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26\
-  157   \fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df\
-  158   \25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1\
-  159   \f525f0f724f0f921")
-  160 
-  161 -- | Given a number t in the range [0,1], returns the corresponding color from
-  162 --   the “sinebow” color scheme by Jim Bumgardner and Charlie Loyd.
-  163 --
-  164 --   <<docs/gifs/doc_sinebow.gif>>
-  165 sinebow :: Double -> PixelRGB8
-  166 sinebow t = PixelRGB8 r g b
-  167   where
-  168     pi_1_3 = pi / 3
-  169     pi_2_3 = pi * 2 / 3
-  170     x = (0.5 - t) * pi
-  171     r = round $ 255 * sin x**2
-  172     g = round $ 255 * sin (x+pi_1_3)**2
-  173     b = round $ 255 * sin (x+pi_2_3)**2
-  174 
-  175 -- | Given a number t in the range [0,1], returns the corresponding color from
-  176 --   the “cividis” color vision deficiency-optimized color scheme designed by
-  177 --   Nuñez, Anderton, and Renslow, represented as an RGB string.
-  178 --
-  179 --   <<docs/gifs/doc_cividis.gif>>
-  180 cividis :: Double -> PixelRGB8
-  181 cividis t = PixelRGB8 red green blue
-  182   where
-  183     red   = trunc $ round(-4.54 - t * (35.34 - t * (2381.73 - t * (6402.7 - t * (7024.72 - t * 2710.57)))))
-  184     green = trunc $ round(32.49 + t * (170.73 + t * (52.82 - t * (131.46 - t * (176.58 - t * 67.37)))))
-  185     blue  = trunc $ round(81.24 + t * (442.36 - t * (2482.43 - t * (6167.24 - t * (6614.94 - t * 2475.67)))))
-  186     trunc :: Integer -> Pixel8
-  187     trunc = fromIntegral . min 255 . max 0
-  188 
-  189 -- | Jet colormap. Used to be the default in matlab. Obsolete.
-  190 --
-  191 --   <<docs/gifs/doc_jet.gif>>
-  192 jet :: Double -> PixelRGB8
-  193 jet t = PixelRGB8 red green blue
-  194   where
-  195     red   = trunc $ min (4*t - 1.5) (-4*t + 4.5)
-  196     green = trunc $ min (4*t - 0.5) (-4*t + 3.5)
-  197     blue  = trunc $ min (4*t + 0.5) (-4*t + 2.5)
-  198     trunc :: Double -> Pixel8
-  199     trunc = round . min 255 . max 0 . (*) 255
-  200 
-  201 -- | hsv colormap. Goes from 0 degrees to 360 degrees.
-  202 --
-  203 --   <<docs/gifs/doc_hsv.gif>>
-  204 hsv :: Double -> PixelRGB8
-  205 hsv t = PixelRGB8 (round $ r*255) (round $ g*255) (round $ b*255)
-  206   where
-  207     RGB r g b = HSV.hsv (t * 360) 1 1
-  208 
-  209 -- | Matlab hsv colormap. Goes from 0 degrees to 330 degrees.
-  210 --
-  211 --   <<docs/gifs/doc_hsvMatlab.gif>>
-  212 hsvMatlab :: Double -> PixelRGB8
-  213 hsvMatlab t = PixelRGB8 (round $ r*255) (round $ g*255) (round $ b*255)
-  214   where
-  215     RGB r g b = HSV.hsv (t * 330) 1 1
-  216 
-  217 -- | Greyscale colormap.
-  218 --
-  219 --   <<docs/gifs/doc_greyscale.gif>>
-  220 greyscale :: Double -> PixelRGB8
-  221 greyscale t = PixelRGB8 v v v
-  222   where
-  223     v = round $ t * 255
-  224 
-  225 -- | Parula is the default colormap for matlab.
-  226 --
-  227 --   <<docs/gifs/doc_parula.gif>>
-  228 parula :: Double -> PixelRGB8
-  229 parula = ramp vec
-  230   where
-  231     vec = V.fromList $ pixels colorList
-  232     pixels [] = []
-  233     pixels (r:g:b:xs) =
-  234       PixelRGB8 (round $ r*255) (round $ g*255) (round $ b*255) :
-  235       pixels xs
-  236     pixels _ = error "Reanimate.ColorMap.parula: Broken data"
-  237     colorList :: [Double]
-  238     colorList =
-  239        [0.2081, 0.1663, 0.5292
-  240        ,0.2091, 0.1721, 0.5411
-  241        ,0.2101, 0.1779, 0.5530
-  242        ,0.2109, 0.1837, 0.5650
-  243        ,0.2116, 0.1895, 0.5771
-  244        ,0.2121, 0.1954, 0.5892
-  245        ,0.2124, 0.2013, 0.6013
-  246        ,0.2125, 0.2072, 0.6135
-  247        ,0.2123, 0.2132, 0.6258
-  248        ,0.2118, 0.2192, 0.6381
-  249        ,0.2111, 0.2253, 0.6505
-  250        ,0.2099, 0.2315, 0.6629
-  251        ,0.2084, 0.2377, 0.6753
-  252        ,0.2063, 0.2440, 0.6878
-  253        ,0.2038, 0.2503, 0.7003
-  254        ,0.2006, 0.2568, 0.7129
-  255        ,0.1968, 0.2632, 0.7255
-  256        ,0.1921, 0.2698, 0.7381
-  257        ,0.1867, 0.2764, 0.7507
-  258        ,0.1802, 0.2832, 0.7634
-  259        ,0.1728, 0.2902, 0.7762
-  260        ,0.1641, 0.2975, 0.7890
-  261        ,0.1541, 0.3052, 0.8017
-  262        ,0.1427, 0.3132, 0.8145
-  263        ,0.1295, 0.3217, 0.8269
-  264        ,0.1147, 0.3306, 0.8387
-  265        ,0.0986, 0.3397, 0.8495
-  266        ,0.0816, 0.3486, 0.8588
-  267        ,0.0646, 0.3572, 0.8664
-  268        ,0.0482, 0.3651, 0.8722
-  269        ,0.0329, 0.3724, 0.8765
-  270        ,0.0213, 0.3792, 0.8796
-  271        ,0.0136, 0.3853, 0.8815
-  272        ,0.0086, 0.3911, 0.8827
-  273        ,0.0060, 0.3965, 0.8833
-  274        ,0.0051, 0.4017, 0.8834
-  275        ,0.0054, 0.4066, 0.8831
-  276        ,0.0067, 0.4113, 0.8825
-  277        ,0.0089, 0.4159, 0.8816
-  278        ,0.0116, 0.4203, 0.8805
-  279        ,0.0148, 0.4246, 0.8793
-  280        ,0.0184, 0.4288, 0.8779
-  281        ,0.0223, 0.4329, 0.8763
-  282        ,0.0264, 0.4370, 0.8747
-  283        ,0.0306, 0.4410, 0.8729
-  284        ,0.0349, 0.4449, 0.8711
-  285        ,0.0394, 0.4488, 0.8692
-  286        ,0.0437, 0.4526, 0.8672
-  287        ,0.0477, 0.4564, 0.8652
-  288        ,0.0514, 0.4602, 0.8632
-  289        ,0.0549, 0.4640, 0.8611
-  290        ,0.0582, 0.4677, 0.8589
-  291        ,0.0612, 0.4714, 0.8568
-  292        ,0.0640, 0.4751, 0.8546
-  293        ,0.0666, 0.4788, 0.8525
-  294        ,0.0689, 0.4825, 0.8503
-  295        ,0.0710, 0.4862, 0.8481
-  296        ,0.0729, 0.4899, 0.8460
-  297        ,0.0746, 0.4937, 0.8439
-  298        ,0.0761, 0.4974, 0.8418
-  299        ,0.0773, 0.5012, 0.8398
-  300        ,0.0782, 0.5051, 0.8378
-  301        ,0.0789, 0.5089, 0.8359
-  302        ,0.0794, 0.5129, 0.8341
-  303        ,0.0795, 0.5169, 0.8324
-  304        ,0.0793, 0.5210, 0.8308
-  305        ,0.0788, 0.5251, 0.8293
-  306        ,0.0778, 0.5295, 0.8280
-  307        ,0.0764, 0.5339, 0.8270
-  308        ,0.0746, 0.5384, 0.8261
-  309        ,0.0724, 0.5431, 0.8253
-  310        ,0.0698, 0.5479, 0.8247
-  311        ,0.0668, 0.5527, 0.8243
-  312        ,0.0636, 0.5577, 0.8239
-  313        ,0.0600, 0.5627, 0.8237
-  314        ,0.0562, 0.5677, 0.8234
-  315        ,0.0523, 0.5727, 0.8231
-  316        ,0.0484, 0.5777, 0.8228
-  317        ,0.0445, 0.5826, 0.8223
-  318        ,0.0408, 0.5874, 0.8217
-  319        ,0.0372, 0.5922, 0.8209
-  320        ,0.0342, 0.5968, 0.8198
-  321        ,0.0317, 0.6012, 0.8186
-  322        ,0.0296, 0.6055, 0.8171
-  323        ,0.0279, 0.6097, 0.8154
-  324        ,0.0265, 0.6137, 0.8135
-  325        ,0.0255, 0.6176, 0.8114
-  326        ,0.0248, 0.6214, 0.8091
-  327        ,0.0243, 0.6250, 0.8066
-  328        ,0.0239, 0.6285, 0.8039
-  329        ,0.0237, 0.6319, 0.8010
-  330        ,0.0235, 0.6352, 0.7980
-  331        ,0.0233, 0.6384, 0.7948
-  332        ,0.0231, 0.6415, 0.7916
-  333        ,0.0230, 0.6445, 0.7881
-  334        ,0.0229, 0.6474, 0.7846
-  335        ,0.0227, 0.6503, 0.7810
-  336        ,0.0227, 0.6531, 0.7773
-  337        ,0.0232, 0.6558, 0.7735
-  338        ,0.0238, 0.6585, 0.7696
-  339        ,0.0246, 0.6611, 0.7656
-  340        ,0.0263, 0.6637, 0.7615
-  341        ,0.0282, 0.6663, 0.7574
-  342        ,0.0306, 0.6688, 0.7532
-  343        ,0.0338, 0.6712, 0.7490
-  344        ,0.0373, 0.6737, 0.7446
-  345        ,0.0418, 0.6761, 0.7402
-  346        ,0.0467, 0.6784, 0.7358
-  347        ,0.0516, 0.6808, 0.7313
-  348        ,0.0574, 0.6831, 0.7267
-  349        ,0.0629, 0.6854, 0.7221
-  350        ,0.0692, 0.6877, 0.7173
-  351        ,0.0755, 0.6899, 0.7126
-  352        ,0.0820, 0.6921, 0.7078
-  353        ,0.0889, 0.6943, 0.7029
-  354        ,0.0956, 0.6965, 0.6979
-  355        ,0.1031, 0.6986, 0.6929
-  356        ,0.1104, 0.7007, 0.6878
-  357        ,0.1180, 0.7028, 0.6827
-  358        ,0.1258, 0.7049, 0.6775
-  359        ,0.1335, 0.7069, 0.6723
-  360        ,0.1418, 0.7089, 0.6669
-  361        ,0.1499, 0.7109, 0.6616
-  362        ,0.1585, 0.7129, 0.6561
-  363        ,0.1671, 0.7148, 0.6507
-  364        ,0.1758, 0.7168, 0.6451
-  365        ,0.1849, 0.7186, 0.6395
-  366        ,0.1938, 0.7205, 0.6338
-  367        ,0.2033, 0.7223, 0.6281
-  368        ,0.2128, 0.7241, 0.6223
-  369        ,0.2224, 0.7259, 0.6165
-  370        ,0.2324, 0.7275, 0.6107
-  371        ,0.2423, 0.7292, 0.6048
-  372        ,0.2527, 0.7308, 0.5988
-  373        ,0.2631, 0.7324, 0.5929
-  374        ,0.2735, 0.7339, 0.5869
-  375        ,0.2845, 0.7354, 0.5809
-  376        ,0.2953, 0.7368, 0.5749
-  377        ,0.3064, 0.7381, 0.5689
-  378        ,0.3177, 0.7394, 0.5630
-  379        ,0.3289, 0.7406, 0.5570
-  380        ,0.3405, 0.7417, 0.5512
-  381        ,0.3520, 0.7428, 0.5453
-  382        ,0.3635, 0.7438, 0.5396
-  383        ,0.3753, 0.7446, 0.5339
-  384        ,0.3869, 0.7454, 0.5283
-  385        ,0.3986, 0.7461, 0.5229
-  386        ,0.4103, 0.7467, 0.5175
-  387        ,0.4218, 0.7473, 0.5123
-  388        ,0.4334, 0.7477, 0.5072
-  389        ,0.4447, 0.7482, 0.5021
-  390        ,0.4561, 0.7485, 0.4972
-  391        ,0.4672, 0.7487, 0.4924
-  392        ,0.4783, 0.7489, 0.4877
-  393        ,0.4892, 0.7491, 0.4831
-  394        ,0.5000, 0.7491, 0.4786
-  395        ,0.5106, 0.7492, 0.4741
-  396        ,0.5212, 0.7492, 0.4698
-  397        ,0.5315, 0.7491, 0.4655
-  398        ,0.5418, 0.7490, 0.4613
-  399        ,0.5519, 0.7489, 0.4571
-  400        ,0.5619, 0.7487, 0.4531
-  401        ,0.5718, 0.7485, 0.4490
-  402        ,0.5816, 0.7482, 0.4451
-  403        ,0.5913, 0.7479, 0.4412
-  404        ,0.6009, 0.7476, 0.4374
-  405        ,0.6103, 0.7473, 0.4335
-  406        ,0.6197, 0.7469, 0.4298
-  407        ,0.6290, 0.7465, 0.4261
-  408        ,0.6382, 0.7460, 0.4224
-  409        ,0.6473, 0.7456, 0.4188
-  410        ,0.6564, 0.7451, 0.4152
-  411        ,0.6653, 0.7446, 0.4116
-  412        ,0.6742, 0.7441, 0.4081
-  413        ,0.6830, 0.7435, 0.4046
-  414        ,0.6918, 0.7430, 0.4011
-  415        ,0.7004, 0.7424, 0.3976
-  416        ,0.7091, 0.7418, 0.3942
-  417        ,0.7176, 0.7412, 0.3908
-  418        ,0.7261, 0.7405, 0.3874
-  419        ,0.7346, 0.7399, 0.3840
-  420        ,0.7430, 0.7392, 0.3806
-  421        ,0.7513, 0.7385, 0.3773
-  422        ,0.7596, 0.7378, 0.3739
-  423        ,0.7679, 0.7372, 0.3706
-  424        ,0.7761, 0.7364, 0.3673
-  425        ,0.7843, 0.7357, 0.3639
-  426        ,0.7924, 0.7350, 0.3606
-  427        ,0.8005, 0.7343, 0.3573
-  428        ,0.8085, 0.7336, 0.3539
-  429        ,0.8166, 0.7329, 0.3506
-  430        ,0.8246, 0.7322, 0.3472
-  431        ,0.8325, 0.7315, 0.3438
-  432        ,0.8405, 0.7308, 0.3404
-  433        ,0.8484, 0.7301, 0.3370
-  434        ,0.8563, 0.7294, 0.3336
-  435        ,0.8642, 0.7288, 0.3300
-  436        ,0.8720, 0.7282, 0.3265
-  437        ,0.8798, 0.7276, 0.3229
-  438        ,0.8877, 0.7271, 0.3193
-  439        ,0.8954, 0.7266, 0.3156
-  440        ,0.9032, 0.7262, 0.3117
-  441        ,0.9110, 0.7259, 0.3078
-  442        ,0.9187, 0.7256, 0.3038
-  443        ,0.9264, 0.7256, 0.2996
-  444        ,0.9341, 0.7256, 0.2953
-  445        ,0.9417, 0.7259, 0.2907
-  446        ,0.9493, 0.7264, 0.2859
-  447        ,0.9567, 0.7273, 0.2808
-  448        ,0.9639, 0.7285, 0.2754
-  449        ,0.9708, 0.7303, 0.2696
-  450        ,0.9773, 0.7326, 0.2634
-  451        ,0.9831, 0.7355, 0.2570
-  452        ,0.9882, 0.7390, 0.2504
-  453        ,0.9922, 0.7431, 0.2437
-  454        ,0.9952, 0.7476, 0.2373
-  455        ,0.9973, 0.7524, 0.2310
-  456        ,0.9986, 0.7573, 0.2251
-  457        ,0.9991, 0.7624, 0.2195
-  458        ,0.9990, 0.7675, 0.2141
-  459        ,0.9985, 0.7726, 0.2090
-  460        ,0.9976, 0.7778, 0.2042
-  461        ,0.9964, 0.7829, 0.1995
-  462        ,0.9950, 0.7880, 0.1949
-  463        ,0.9933, 0.7931, 0.1905
-  464        ,0.9914, 0.7981, 0.1863
-  465        ,0.9894, 0.8032, 0.1821
-  466        ,0.9873, 0.8083, 0.1780
-  467        ,0.9851, 0.8133, 0.1740
-  468        ,0.9828, 0.8184, 0.1700
-  469        ,0.9805, 0.8235, 0.1661
-  470        ,0.9782, 0.8286, 0.1622
-  471        ,0.9759, 0.8337, 0.1583
-  472        ,0.9736, 0.8389, 0.1544
-  473        ,0.9713, 0.8441, 0.1505
-  474        ,0.9692, 0.8494, 0.1465
-  475        ,0.9672, 0.8548, 0.1425
-  476        ,0.9654, 0.8603, 0.1385
-  477        ,0.9638, 0.8659, 0.1343
-  478        ,0.9623, 0.8716, 0.1301
-  479        ,0.9611, 0.8774, 0.1258
-  480        ,0.9600, 0.8834, 0.1215
-  481        ,0.9593, 0.8895, 0.1171
-  482        ,0.9588, 0.8958, 0.1126
-  483        ,0.9586, 0.9022, 0.1082
-  484        ,0.9587, 0.9088, 0.1036
-  485        ,0.9591, 0.9155, 0.0990
-  486        ,0.9599, 0.9225, 0.0944
-  487        ,0.9610, 0.9296, 0.0897
-  488        ,0.9624, 0.9368, 0.0850
-  489        ,0.9641, 0.9443, 0.0802
-  490        ,0.9662, 0.9518, 0.0753
-  491        ,0.9685, 0.9595, 0.0703
-  492        ,0.9710, 0.9673, 0.0651
-  493        ,0.9736, 0.9752, 0.0597
-  494        ,0.9763, 0.9831, 0.0538]
-  495 
-  496 --------------------------------------------------------------------------------
-  497 -- Helpers
-  498 
-  499 colors :: Text -> Vector PixelRGB8
-  500 colors = V.fromList . map (toColor . map (fromIntegral . digitToInt) . T.unpack) . T.chunksOf 6
-  501   where
-  502     toColor [r1,r2,g1,g2,b1,b2] =
-  503       PixelRGB8 (r1 `shiftL` 4 + r2) (g1 `shiftL` 4 + g2) (b1 `shiftL` 4+b2)
-  504     toColor _ = error "Reanimate.ColorMap.colors: Broken data"
-  505 
-  506 ramp :: Vector PixelRGB8 -> Double -> PixelRGB8
-  507 ramp v = \t -> v V.! max 0 (min (len-1) $ round $ t * (len'-1))
-  508   where
-  509     len = V.length v
-  510     len' = fromIntegral len
+    2 module Reanimate.ColorMap
+    3   ( turbo
+    4   , viridis
+    5   , magma
+    6   , inferno
+    7   , plasma
+    8   , sinebow
+    9   , parula
+   10   , cividis
+   11   , jet
+   12   , hsv
+   13   , hsvMatlab
+   14   , greyscale
+   15   ) where
+   16 
+   17 import Data.Text (Text)
+   18 import Data.Vector (Vector)
+   19 import qualified Data.Text as T
+   20 import qualified Data.Vector as V
+   21 import Codec.Picture
+   22 import Data.Char
+   23 import Data.Bits
+   24 import qualified Data.Colour.RGBSpace.HSV as HSV
+   25 import           Data.Colour.RGBSpace
+   26 
+   27 -- | Given a number t in the range [0,1], returns the corresponding color from
+   28 --   the “turbo” color scheme by Anton Mikhailov.
+   29 --
+   30 --   <<docs/gifs/doc_turbo.gif>>
+   31 turbo :: Double -> PixelRGB8
+   32 turbo t = PixelRGB8 red green blue
+   33   where
+   34     red   = trunc (round (34.61 + t * (1172.33 - t * (10793.56 - t * (33300.12 - t * (38394.49 - t * 14825.05))))))
+   35     green = trunc (round (23.31 + t * (557.33 + t * (1225.33 - t * (3574.96 - t * (1073.77 + t * 707.56))))))
+   36     blue  = trunc (round (27.2 + t * (3211.1 - t * (15327.97 - t * (27814 - t * (22569.18 - t * 6838.66))))))
+   37     trunc :: Integer -> Pixel8
+   38     trunc = fromIntegral . min 255 . max 0
+   39 
+   40 -- | Given a number t in the range [0,1], returns the corresponding color from
+   41 --   the “viridis” perceptually-uniform color scheme designed by van der Walt,
+   42 --   Smith and Firing for matplotlib, represented as an RGB string.
+   43 --
+   44 --   <<docs/gifs/doc_viridis.gif>>
+   45 viridis :: Double -> PixelRGB8
+   46 viridis = ramp (colors
+   47   "44015444025645045745055946075a46085c460a5d460b5e470d60470e614710634711644713\
+   48   \6548146748166848176948186a481a6c481b6d481c6e481d6f481f7048207148217348237448\
+   49   \2475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f\
+   50   \463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142\
+   51   \874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b\
+   52   \518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d\
+   53   \355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b\
+   54   \8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a\
+   55   \778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e\
+   56   \25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f\
+   57   \8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e\
+   58   \9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a685\
+   59   \22a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db2\
+   60   \7d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340\
+   61   \bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c765\
+   62   \5ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d0\
+   63   \5477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195\
+   64   \d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2b\
+   65   \b8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e2\
+   66   \19dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8\
+   67   \e621fbe723fde725")
+   68 
+   69 -- | Given a number t in the range [0,1], returns the corresponding color from
+   70 --   the “magma” perceptually-uniform color scheme designed by van der Walt and
+   71 --   Smith for matplotlib, represented as an RGB string.
+   72 --
+   73 --   <<docs/gifs/doc_magma.gif>>
+   74 magma :: Double -> PixelRGB8
+   75 magma = ramp (colors
+   76   "00000401000501010601010802010902020b02020d03030f0303120404140504160605180605\
+   77   \1a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d3414\
+   78   \0e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e221150241253\
+   79   \25125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f\
+   80   \6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f\
+   81   \127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980\
+   82   \641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621\
+   83   \817822817922827b23827c23827e24828025828125818326818426818627818827818928818b\
+   84   \29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7f\
+   85   \a02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb336\
+   86   \7ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c8\
+   87   \3e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476a\
+   88   \dc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb57\
+   89   \60ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf6\
+   90   \6c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835f\
+   91   \fb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b\
+   92   \6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afe\
+   93   \b47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8d\
+   94   \fecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2\
+   95   \a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fc\
+   96   \f9bbfcfbbdfcfdbf")
+   97 
+   98 -- | Given a number t in the range [0,1], returns the corresponding color from
+   99 --   the “inferno” perceptually-uniform color scheme designed by van der Walt
+  100 --   and Smith for matplotlib, represented as an RGB string.
+  101 --
+  102 --   <<docs/gifs/doc_inferno.gif>>
+  103 inferno :: Double -> PixelRGB8
+  104 inferno = ramp (colors
+  105   "00000401000501010601010802010a02020c02020e0302100403120403140504170604190705\
+  106   \1b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b3716\
+  107   \0b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b55\
+  108   \2b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a\
+  109   \67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d55\
+  110   \0f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e\
+  111   \6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e\
+  112   \6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f246990256892\
+  113   \25689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60\
+  114   \a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b935\
+  115   \56ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb\
+  116   \4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3c\
+  117   \db503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee860\
+  118   \2de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2\
+  119   \741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890c\
+  120   \f98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca1\
+  121   \08fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfb\
+  122   \ba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13d\
+  123   \f7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea\
+  124   \69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9\
+  125   \fc9dfafda1fcffa4")
+  126 
+  127 -- | Given a number t in the range [0,1], returns the corresponding color from
+  128 --   the “plasma” perceptually-uniform color scheme designed by van der Walt and
+  129 --   Smith for matplotlib, represented as an RGB string.
+  130 --
+  131 --   <<docs/gifs/doc_plasma.gif>>
+  132 plasma :: Double -> PixelRGB8
+  133 plasma = ramp (colors
+  134   "0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05\
+  135   \932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41\
+  136   \049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a4\
+  137   \5601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900\
+  138   \a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d\
+  139   \03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca4\
+  140   \8f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a\
+  141   \9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b0\
+  142   \2991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786\
+  143   \be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca45\
+  144   \7acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5\
+  145   \546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263\
+  146   \e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e971\
+  147   \58e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1\
+  148   \814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143\
+  149   \f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca3\
+  150   \38fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efe\
+  151   \b72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26\
+  152   \fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df\
+  153   \25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1\
+  154   \f525f0f724f0f921")
+  155 
+  156 -- | Given a number t in the range [0,1], returns the corresponding color from
+  157 --   the “sinebow” color scheme by Jim Bumgardner and Charlie Loyd.
+  158 --
+  159 --   <<docs/gifs/doc_sinebow.gif>>
+  160 sinebow :: Double -> PixelRGB8
+  161 sinebow t = PixelRGB8 r g b
+  162   where
+  163     pi_1_3 = pi / 3
+  164     pi_2_3 = pi * 2 / 3
+  165     x = (0.5 - t) * pi
+  166     r = round $ 255 * sin x**2
+  167     g = round $ 255 * sin (x+pi_1_3)**2
+  168     b = round $ 255 * sin (x+pi_2_3)**2
+  169 
+  170 -- | Given a number t in the range [0,1], returns the corresponding color from
+  171 --   the “cividis” color vision deficiency-optimized color scheme designed by
+  172 --   Nuñez, Anderton, and Renslow, represented as an RGB string.
+  173 --
+  174 --   <<docs/gifs/doc_cividis.gif>>
+  175 cividis :: Double -> PixelRGB8
+  176 cividis t = PixelRGB8 red green blue
+  177   where
+  178     red   = trunc $ round(-4.54 - t * (35.34 - t * (2381.73 - t * (6402.7 - t * (7024.72 - t * 2710.57)))))
+  179     green = trunc $ round(32.49 + t * (170.73 + t * (52.82 - t * (131.46 - t * (176.58 - t * 67.37)))))
+  180     blue  = trunc $ round(81.24 + t * (442.36 - t * (2482.43 - t * (6167.24 - t * (6614.94 - t * 2475.67)))))
+  181     trunc :: Integer -> Pixel8
+  182     trunc = fromIntegral . min 255 . max 0
+  183 
+  184 -- | Jet colormap. Used to be the default in matlab. Obsolete.
+  185 --
+  186 --   <<docs/gifs/doc_jet.gif>>
+  187 jet :: Double -> PixelRGB8
+  188 jet t = PixelRGB8 red green blue
+  189   where
+  190     red   = trunc $ min (4*t - 1.5) (-4*t + 4.5)
+  191     green = trunc $ min (4*t - 0.5) (-4*t + 3.5)
+  192     blue  = trunc $ min (4*t + 0.5) (-4*t + 2.5)
+  193     trunc :: Double -> Pixel8
+  194     trunc = round . min 255 . max 0 . (*) 255
+  195 
+  196 -- | hsv colormap. Goes from 0 degrees to 360 degrees.
+  197 --
+  198 --   <<docs/gifs/doc_hsv.gif>>
+  199 hsv :: Double -> PixelRGB8
+  200 hsv t = PixelRGB8 (round $ r*255) (round $ g*255) (round $ b*255)
+  201   where
+  202     RGB r g b = HSV.hsv (t * 360) 1 1
+  203 
+  204 -- | Matlab hsv colormap. Goes from 0 degrees to 330 degrees.
+  205 --
+  206 --   <<docs/gifs/doc_hsvMatlab.gif>>
+  207 hsvMatlab :: Double -> PixelRGB8
+  208 hsvMatlab t = PixelRGB8 (round $ r*255) (round $ g*255) (round $ b*255)
+  209   where
+  210     RGB r g b = HSV.hsv (t * 330) 1 1
+  211 
+  212 -- | Greyscale colormap.
+  213 --
+  214 --   <<docs/gifs/doc_greyscale.gif>>
+  215 greyscale :: Double -> PixelRGB8
+  216 greyscale t = PixelRGB8 v v v
+  217   where
+  218     v = round $ t * 255
+  219 
+  220 -- | Parula is the default colormap for matlab.
+  221 --
+  222 --   <<docs/gifs/doc_parula.gif>>
+  223 parula :: Double -> PixelRGB8
+  224 parula = ramp vec
+  225   where
+  226     vec = V.fromList $ pixels colorList
+  227     pixels [] = []
+  228     pixels (r:g:b:xs) =
+  229       PixelRGB8 (round $ r*255) (round $ g*255) (round $ b*255) :
+  230       pixels xs
+  231     pixels _ = error "Reanimate.ColorMap.parula: Broken data"
+  232     colorList :: [Double]
+  233     colorList =
+  234        [0.2081, 0.1663, 0.5292
+  235        ,0.2091, 0.1721, 0.5411
+  236        ,0.2101, 0.1779, 0.5530
+  237        ,0.2109, 0.1837, 0.5650
+  238        ,0.2116, 0.1895, 0.5771
+  239        ,0.2121, 0.1954, 0.5892
+  240        ,0.2124, 0.2013, 0.6013
+  241        ,0.2125, 0.2072, 0.6135
+  242        ,0.2123, 0.2132, 0.6258
+  243        ,0.2118, 0.2192, 0.6381
+  244        ,0.2111, 0.2253, 0.6505
+  245        ,0.2099, 0.2315, 0.6629
+  246        ,0.2084, 0.2377, 0.6753
+  247        ,0.2063, 0.2440, 0.6878
+  248        ,0.2038, 0.2503, 0.7003
+  249        ,0.2006, 0.2568, 0.7129
+  250        ,0.1968, 0.2632, 0.7255
+  251        ,0.1921, 0.2698, 0.7381
+  252        ,0.1867, 0.2764, 0.7507
+  253        ,0.1802, 0.2832, 0.7634
+  254        ,0.1728, 0.2902, 0.7762
+  255        ,0.1641, 0.2975, 0.7890
+  256        ,0.1541, 0.3052, 0.8017
+  257        ,0.1427, 0.3132, 0.8145
+  258        ,0.1295, 0.3217, 0.8269
+  259        ,0.1147, 0.3306, 0.8387
+  260        ,0.0986, 0.3397, 0.8495
+  261        ,0.0816, 0.3486, 0.8588
+  262        ,0.0646, 0.3572, 0.8664
+  263        ,0.0482, 0.3651, 0.8722
+  264        ,0.0329, 0.3724, 0.8765
+  265        ,0.0213, 0.3792, 0.8796
+  266        ,0.0136, 0.3853, 0.8815
+  267        ,0.0086, 0.3911, 0.8827
+  268        ,0.0060, 0.3965, 0.8833
+  269        ,0.0051, 0.4017, 0.8834
+  270        ,0.0054, 0.4066, 0.8831
+  271        ,0.0067, 0.4113, 0.8825
+  272        ,0.0089, 0.4159, 0.8816
+  273        ,0.0116, 0.4203, 0.8805
+  274        ,0.0148, 0.4246, 0.8793
+  275        ,0.0184, 0.4288, 0.8779
+  276        ,0.0223, 0.4329, 0.8763
+  277        ,0.0264, 0.4370, 0.8747
+  278        ,0.0306, 0.4410, 0.8729
+  279        ,0.0349, 0.4449, 0.8711
+  280        ,0.0394, 0.4488, 0.8692
+  281        ,0.0437, 0.4526, 0.8672
+  282        ,0.0477, 0.4564, 0.8652
+  283        ,0.0514, 0.4602, 0.8632
+  284        ,0.0549, 0.4640, 0.8611
+  285        ,0.0582, 0.4677, 0.8589
+  286        ,0.0612, 0.4714, 0.8568
+  287        ,0.0640, 0.4751, 0.8546
+  288        ,0.0666, 0.4788, 0.8525
+  289        ,0.0689, 0.4825, 0.8503
+  290        ,0.0710, 0.4862, 0.8481
+  291        ,0.0729, 0.4899, 0.8460
+  292        ,0.0746, 0.4937, 0.8439
+  293        ,0.0761, 0.4974, 0.8418
+  294        ,0.0773, 0.5012, 0.8398
+  295        ,0.0782, 0.5051, 0.8378
+  296        ,0.0789, 0.5089, 0.8359
+  297        ,0.0794, 0.5129, 0.8341
+  298        ,0.0795, 0.5169, 0.8324
+  299        ,0.0793, 0.5210, 0.8308
+  300        ,0.0788, 0.5251, 0.8293
+  301        ,0.0778, 0.5295, 0.8280
+  302        ,0.0764, 0.5339, 0.8270
+  303        ,0.0746, 0.5384, 0.8261
+  304        ,0.0724, 0.5431, 0.8253
+  305        ,0.0698, 0.5479, 0.8247
+  306        ,0.0668, 0.5527, 0.8243
+  307        ,0.0636, 0.5577, 0.8239
+  308        ,0.0600, 0.5627, 0.8237
+  309        ,0.0562, 0.5677, 0.8234
+  310        ,0.0523, 0.5727, 0.8231
+  311        ,0.0484, 0.5777, 0.8228
+  312        ,0.0445, 0.5826, 0.8223
+  313        ,0.0408, 0.5874, 0.8217
+  314        ,0.0372, 0.5922, 0.8209
+  315        ,0.0342, 0.5968, 0.8198
+  316        ,0.0317, 0.6012, 0.8186
+  317        ,0.0296, 0.6055, 0.8171
+  318        ,0.0279, 0.6097, 0.8154
+  319        ,0.0265, 0.6137, 0.8135
+  320        ,0.0255, 0.6176, 0.8114
+  321        ,0.0248, 0.6214, 0.8091
+  322        ,0.0243, 0.6250, 0.8066
+  323        ,0.0239, 0.6285, 0.8039
+  324        ,0.0237, 0.6319, 0.8010
+  325        ,0.0235, 0.6352, 0.7980
+  326        ,0.0233, 0.6384, 0.7948
+  327        ,0.0231, 0.6415, 0.7916
+  328        ,0.0230, 0.6445, 0.7881
+  329        ,0.0229, 0.6474, 0.7846
+  330        ,0.0227, 0.6503, 0.7810
+  331        ,0.0227, 0.6531, 0.7773
+  332        ,0.0232, 0.6558, 0.7735
+  333        ,0.0238, 0.6585, 0.7696
+  334        ,0.0246, 0.6611, 0.7656
+  335        ,0.0263, 0.6637, 0.7615
+  336        ,0.0282, 0.6663, 0.7574
+  337        ,0.0306, 0.6688, 0.7532
+  338        ,0.0338, 0.6712, 0.7490
+  339        ,0.0373, 0.6737, 0.7446
+  340        ,0.0418, 0.6761, 0.7402
+  341        ,0.0467, 0.6784, 0.7358
+  342        ,0.0516, 0.6808, 0.7313
+  343        ,0.0574, 0.6831, 0.7267
+  344        ,0.0629, 0.6854, 0.7221
+  345        ,0.0692, 0.6877, 0.7173
+  346        ,0.0755, 0.6899, 0.7126
+  347        ,0.0820, 0.6921, 0.7078
+  348        ,0.0889, 0.6943, 0.7029
+  349        ,0.0956, 0.6965, 0.6979
+  350        ,0.1031, 0.6986, 0.6929
+  351        ,0.1104, 0.7007, 0.6878
+  352        ,0.1180, 0.7028, 0.6827
+  353        ,0.1258, 0.7049, 0.6775
+  354        ,0.1335, 0.7069, 0.6723
+  355        ,0.1418, 0.7089, 0.6669
+  356        ,0.1499, 0.7109, 0.6616
+  357        ,0.1585, 0.7129, 0.6561
+  358        ,0.1671, 0.7148, 0.6507
+  359        ,0.1758, 0.7168, 0.6451
+  360        ,0.1849, 0.7186, 0.6395
+  361        ,0.1938, 0.7205, 0.6338
+  362        ,0.2033, 0.7223, 0.6281
+  363        ,0.2128, 0.7241, 0.6223
+  364        ,0.2224, 0.7259, 0.6165
+  365        ,0.2324, 0.7275, 0.6107
+  366        ,0.2423, 0.7292, 0.6048
+  367        ,0.2527, 0.7308, 0.5988
+  368        ,0.2631, 0.7324, 0.5929
+  369        ,0.2735, 0.7339, 0.5869
+  370        ,0.2845, 0.7354, 0.5809
+  371        ,0.2953, 0.7368, 0.5749
+  372        ,0.3064, 0.7381, 0.5689
+  373        ,0.3177, 0.7394, 0.5630
+  374        ,0.3289, 0.7406, 0.5570
+  375        ,0.3405, 0.7417, 0.5512
+  376        ,0.3520, 0.7428, 0.5453
+  377        ,0.3635, 0.7438, 0.5396
+  378        ,0.3753, 0.7446, 0.5339
+  379        ,0.3869, 0.7454, 0.5283
+  380        ,0.3986, 0.7461, 0.5229
+  381        ,0.4103, 0.7467, 0.5175
+  382        ,0.4218, 0.7473, 0.5123
+  383        ,0.4334, 0.7477, 0.5072
+  384        ,0.4447, 0.7482, 0.5021
+  385        ,0.4561, 0.7485, 0.4972
+  386        ,0.4672, 0.7487, 0.4924
+  387        ,0.4783, 0.7489, 0.4877
+  388        ,0.4892, 0.7491, 0.4831
+  389        ,0.5000, 0.7491, 0.4786
+  390        ,0.5106, 0.7492, 0.4741
+  391        ,0.5212, 0.7492, 0.4698
+  392        ,0.5315, 0.7491, 0.4655
+  393        ,0.5418, 0.7490, 0.4613
+  394        ,0.5519, 0.7489, 0.4571
+  395        ,0.5619, 0.7487, 0.4531
+  396        ,0.5718, 0.7485, 0.4490
+  397        ,0.5816, 0.7482, 0.4451
+  398        ,0.5913, 0.7479, 0.4412
+  399        ,0.6009, 0.7476, 0.4374
+  400        ,0.6103, 0.7473, 0.4335
+  401        ,0.6197, 0.7469, 0.4298
+  402        ,0.6290, 0.7465, 0.4261
+  403        ,0.6382, 0.7460, 0.4224
+  404        ,0.6473, 0.7456, 0.4188
+  405        ,0.6564, 0.7451, 0.4152
+  406        ,0.6653, 0.7446, 0.4116
+  407        ,0.6742, 0.7441, 0.4081
+  408        ,0.6830, 0.7435, 0.4046
+  409        ,0.6918, 0.7430, 0.4011
+  410        ,0.7004, 0.7424, 0.3976
+  411        ,0.7091, 0.7418, 0.3942
+  412        ,0.7176, 0.7412, 0.3908
+  413        ,0.7261, 0.7405, 0.3874
+  414        ,0.7346, 0.7399, 0.3840
+  415        ,0.7430, 0.7392, 0.3806
+  416        ,0.7513, 0.7385, 0.3773
+  417        ,0.7596, 0.7378, 0.3739
+  418        ,0.7679, 0.7372, 0.3706
+  419        ,0.7761, 0.7364, 0.3673
+  420        ,0.7843, 0.7357, 0.3639
+  421        ,0.7924, 0.7350, 0.3606
+  422        ,0.8005, 0.7343, 0.3573
+  423        ,0.8085, 0.7336, 0.3539
+  424        ,0.8166, 0.7329, 0.3506
+  425        ,0.8246, 0.7322, 0.3472
+  426        ,0.8325, 0.7315, 0.3438
+  427        ,0.8405, 0.7308, 0.3404
+  428        ,0.8484, 0.7301, 0.3370
+  429        ,0.8563, 0.7294, 0.3336
+  430        ,0.8642, 0.7288, 0.3300
+  431        ,0.8720, 0.7282, 0.3265
+  432        ,0.8798, 0.7276, 0.3229
+  433        ,0.8877, 0.7271, 0.3193
+  434        ,0.8954, 0.7266, 0.3156
+  435        ,0.9032, 0.7262, 0.3117
+  436        ,0.9110, 0.7259, 0.3078
+  437        ,0.9187, 0.7256, 0.3038
+  438        ,0.9264, 0.7256, 0.2996
+  439        ,0.9341, 0.7256, 0.2953
+  440        ,0.9417, 0.7259, 0.2907
+  441        ,0.9493, 0.7264, 0.2859
+  442        ,0.9567, 0.7273, 0.2808
+  443        ,0.9639, 0.7285, 0.2754
+  444        ,0.9708, 0.7303, 0.2696
+  445        ,0.9773, 0.7326, 0.2634
+  446        ,0.9831, 0.7355, 0.2570
+  447        ,0.9882, 0.7390, 0.2504
+  448        ,0.9922, 0.7431, 0.2437
+  449        ,0.9952, 0.7476, 0.2373
+  450        ,0.9973, 0.7524, 0.2310
+  451        ,0.9986, 0.7573, 0.2251
+  452        ,0.9991, 0.7624, 0.2195
+  453        ,0.9990, 0.7675, 0.2141
+  454        ,0.9985, 0.7726, 0.2090
+  455        ,0.9976, 0.7778, 0.2042
+  456        ,0.9964, 0.7829, 0.1995
+  457        ,0.9950, 0.7880, 0.1949
+  458        ,0.9933, 0.7931, 0.1905
+  459        ,0.9914, 0.7981, 0.1863
+  460        ,0.9894, 0.8032, 0.1821
+  461        ,0.9873, 0.8083, 0.1780
+  462        ,0.9851, 0.8133, 0.1740
+  463        ,0.9828, 0.8184, 0.1700
+  464        ,0.9805, 0.8235, 0.1661
+  465        ,0.9782, 0.8286, 0.1622
+  466        ,0.9759, 0.8337, 0.1583
+  467        ,0.9736, 0.8389, 0.1544
+  468        ,0.9713, 0.8441, 0.1505
+  469        ,0.9692, 0.8494, 0.1465
+  470        ,0.9672, 0.8548, 0.1425
+  471        ,0.9654, 0.8603, 0.1385
+  472        ,0.9638, 0.8659, 0.1343
+  473        ,0.9623, 0.8716, 0.1301
+  474        ,0.9611, 0.8774, 0.1258
+  475        ,0.9600, 0.8834, 0.1215
+  476        ,0.9593, 0.8895, 0.1171
+  477        ,0.9588, 0.8958, 0.1126
+  478        ,0.9586, 0.9022, 0.1082
+  479        ,0.9587, 0.9088, 0.1036
+  480        ,0.9591, 0.9155, 0.0990
+  481        ,0.9599, 0.9225, 0.0944
+  482        ,0.9610, 0.9296, 0.0897
+  483        ,0.9624, 0.9368, 0.0850
+  484        ,0.9641, 0.9443, 0.0802
+  485        ,0.9662, 0.9518, 0.0753
+  486        ,0.9685, 0.9595, 0.0703
+  487        ,0.9710, 0.9673, 0.0651
+  488        ,0.9736, 0.9752, 0.0597
+  489        ,0.9763, 0.9831, 0.0538]
+  490 
+  491 --------------------------------------------------------------------------------
+  492 -- Helpers
+  493 
+  494 colors :: Text -> Vector PixelRGB8
+  495 colors = V.fromList . map (toColor . map (fromIntegral . digitToInt) . T.unpack) . T.chunksOf 6
+  496   where
+  497     toColor [r1,r2,g1,g2,b1,b2] =
+  498       PixelRGB8 (r1 `shiftL` 4 + r2) (g1 `shiftL` 4 + g2) (b1 `shiftL` 4+b2)
+  499     toColor _ = error "Reanimate.ColorMap.colors: Broken data"
+  500 
+  501 ramp :: Vector PixelRGB8 -> Double -> PixelRGB8
+  502 ramp v = \t -> v V.! max 0 (min (len-1) $ round $ t * (len'-1))
+  503   where
+  504     len = V.length v
+  505     len' = fromIntegral len
 
 
diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Constants.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Constants.hs.html index 146a989..17214ef 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Constants.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Constants.hs.html @@ -17,57 +17,34 @@ span.spaces { background: white } never executed always true always false
-    1 {- |
-    2   Reanimate configures a consistent, default canvas. The values of this default
-    3   can be observed via the constants in this module. Keep in mind, these values
-    4   describe the /default/ canvas and will not apply to custom viewports.
-    5 -}
-    6 module Reanimate.Constants
-    7   ( screenWidth
-    8   , screenHeight
-    9   , screenTop
-   10   , screenBottom
-   11   , screenLeft
-   12   , screenRight
-   13   , defaultDPI
-   14   , defaultStrokeWidth
-   15   ) where
+    1 module Reanimate.Constants
+    2   ( screenWidth
+    3   , screenHeight
+    4   , screenTop
+    5   , screenBottom
+    6   , screenLeft
+    7   , screenRight
+    8   , defaultDPI
+    9   , defaultStrokeWidth
+   10   ) where
+   11 
+   12 import           Graphics.SvgTree
+   13 
+   14 screenWidth, screenHeight, screenTop :: Fractional a => a
+   15 screenBottom, screenLeft, screenRight :: Fractional a => a
    16 
-   17 import           Graphics.SvgTree
-   18 
-   19 -- | Number of units from the left-most point to the right-most point on the screen.
-   20 screenWidth :: Fractional a => a
-   21 
-   22 -- | Number of units from the bottom to the top of the screen.
-   23 screenHeight :: Fractional a => a
-   24 
-   25 -- | Position of the top of the screen.
-   26 screenTop :: Fractional a => a
-   27 
-   28 -- | Position of the bottom of the screen.
-   29 screenBottom :: Fractional a => a
-   30 
-   31 -- | Position of the left side of the screen.
-   32 screenLeft :: Fractional a => a
-   33 
-   34 -- | Position of the right side of the screen.
-   35 screenRight :: Fractional a => a
-   36 
-   37 screenWidth = 16
-   38 screenHeight = 9
-   39 screenTop = screenHeight/2
-   40 screenBottom = -screenHeight/2
-   41 screenLeft = -screenWidth/2
-   42 screenRight = screenWidth/2
-   43 
-   44 -- | SVG allows measurements in inches which have to be converted to local units.
-   45 --   This value describes how many local units there are in an inch.
-   46 defaultDPI :: Dpi
-   47 defaultDPI = 96
-   48 
-   49 -- | Default thickness of lines.
-   50 defaultStrokeWidth :: Double
-   51 defaultStrokeWidth = 0.05
+   17 screenWidth = 16
+   18 screenHeight = 9
+   19 screenTop = screenHeight/2
+   20 screenBottom = -screenHeight/2
+   21 screenLeft = -screenWidth/2
+   22 screenRight = screenWidth/2
+   23 
+   24 defaultDPI :: Dpi
+   25 defaultDPI = 96
+   26 
+   27 defaultStrokeWidth :: Double
+   28 defaultStrokeWidth = 0.05
 
 
diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Parameters.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Parameters.hs.html index 5f5a10c..7e04797 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Parameters.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Parameters.hs.html @@ -17,128 +17,106 @@ span.spaces { background: white } never executed always true always false
-    1 {- |
-    2   Parameters define the global context of an animation. They are set once
-    3   before an animation is rendered and may not change during rendering.
-    4 -}
-    5 module Reanimate.Parameters
-    6   ( Raster(..)
-    7   , Width
-    8   , Height
-    9   , FPS
-   10   , pRaster
-   11   , pFPS
-   12   , pWidth
-   13   , pHeight
-   14   , pNoExternals
-   15   , pRootDirectory
-   16   , setRaster
-   17   , setFPS
-   18   , setWidth
-   19   , setHeight
-   20   , setNoExternals
-   21   , setRootDirectory
-   22   ) where
-   23 
-   24 import System.IO.Unsafe
-   25 import Data.IORef
+    1 module Reanimate.Parameters
+    2   ( Raster(..)
+    3   , Width
+    4   , Height
+    5   , FPS
+    6   , pRaster
+    7   , pFPS
+    8   , pWidth
+    9   , pHeight
+   10   , pNoExternals
+   11   , pRootDirectory
+   12   , setRaster
+   13   , setFPS
+   14   , setWidth
+   15   , setHeight
+   16   , setNoExternals
+   17   , setRootDirectory
+   18   ) where
+   19 
+   20 import System.IO.Unsafe
+   21 import Data.IORef
+   22 
+   23 type Width = Int
+   24 type Height = Int
+   25 type FPS = Int
    26 
-   27 -- | Width of animation in pixels.
-   28 type Width = Int
-   29 -- | Height of animation in pixels.
-   30 type Height = Int
-   31 -- | Framerate of animation in frames per second.
-   32 type FPS = Int
-   33 
-   34 -- | Raster engines turn SVG images into pixels.
-   35 data Raster
-   36   = RasterNone     -- ^ Do not use any external raster engine. Rely on the browser or ffmpeg.
-   37   | RasterAuto     -- ^ Scan for installed raster engines and pick the fastest one.
-   38   | RasterInkscape -- ^ Use Inkscape to raster SVG images.
-   39   | RasterRSvg     -- ^ Use rsvg-convert to raster SVG images.
-   40   | RasterMagick   -- ^ Use imagemagick to raster SVG images.
-   41   deriving (Show, Eq)
+   27 data Raster
+   28   = RasterNone
+   29   | RasterAuto
+   30   | RasterInkscape
+   31   | RasterRSvg
+   32   | RasterMagick
+   33   deriving (Show, Eq)
+   34 
+   35 {-# NOINLINE pRasterRef #-}
+   36 pRasterRef :: IORef Raster
+   37 pRasterRef = unsafePerformIO (newIORef RasterNone)
+   38 
+   39 {-# NOINLINE pRaster #-}
+   40 pRaster :: Raster
+   41 pRaster = unsafePerformIO (readIORef pRasterRef)
    42 
-   43 {-# NOINLINE pRasterRef #-}
-   44 pRasterRef :: IORef Raster
-   45 pRasterRef = unsafePerformIO (newIORef RasterNone)
-   46 
-   47 {-# NOINLINE pRaster #-}
-   48 -- | Selected raster engine.
-   49 pRaster :: Raster
-   50 pRaster = unsafePerformIO (readIORef pRasterRef)
-   51 
-   52 -- | Set raster engine.
-   53 setRaster :: Raster -> IO ()
-   54 setRaster = writeIORef pRasterRef
-   55 
-   56 {-# NOINLINE pFPSRef #-}
-   57 pFPSRef :: IORef FPS
-   58 pFPSRef = unsafePerformIO (newIORef 0)
-   59 
-   60 {-# NOINLINE pFPS #-}
-   61 -- | Selected framerate.
-   62 pFPS :: FPS
-   63 pFPS = unsafePerformIO (readIORef pFPSRef)
+   43 setRaster :: Raster -> IO ()
+   44 setRaster = writeIORef pRasterRef
+   45 
+   46 {-# NOINLINE pFPSRef #-}
+   47 pFPSRef :: IORef FPS
+   48 pFPSRef = unsafePerformIO (newIORef 0)
+   49 
+   50 {-# NOINLINE pFPS #-}
+   51 pFPS :: FPS
+   52 pFPS = unsafePerformIO (readIORef pFPSRef)
+   53 
+   54 setFPS :: FPS -> IO ()
+   55 setFPS = writeIORef pFPSRef
+   56 
+   57 {-# NOINLINE pWidthRef #-}
+   58 pWidthRef :: IORef FPS
+   59 pWidthRef = unsafePerformIO (newIORef 0)
+   60 
+   61 {-# NOINLINE pWidth #-}
+   62 pWidth :: Width
+   63 pWidth = unsafePerformIO (readIORef pWidthRef)
    64 
-   65 -- | Set desired framerate.
-   66 setFPS :: FPS -> IO ()
-   67 setFPS = writeIORef pFPSRef
+   65 setWidth :: Width -> IO ()
+   66 setWidth = writeIORef pWidthRef
+   67 
    68 
-   69 {-# NOINLINE pWidthRef #-}
-   70 pWidthRef :: IORef FPS
-   71 pWidthRef = unsafePerformIO (newIORef 0)
+   69 {-# NOINLINE pHeightRef #-}
+   70 pHeightRef :: IORef FPS
+   71 pHeightRef = unsafePerformIO (newIORef 0)
    72 
-   73 {-# NOINLINE pWidth #-}
-   74 -- | Width of animation in pixel.
-   75 pWidth :: Width
-   76 pWidth = unsafePerformIO (readIORef pWidthRef)
-   77 
-   78 -- | Set desired width of animation in pixel.
-   79 setWidth :: Width -> IO ()
-   80 setWidth = writeIORef pWidthRef
-   81 
-   82 {-# NOINLINE pHeightRef #-}
-   83 pHeightRef :: IORef FPS
-   84 pHeightRef = unsafePerformIO (newIORef 0)
-   85 
-   86 {-# NOINLINE pHeight #-}
-   87 -- | Height of animation in pixel.
-   88 pHeight :: Height
-   89 pHeight = unsafePerformIO (readIORef pHeightRef)
+   73 {-# NOINLINE pHeight #-}
+   74 pHeight :: Height
+   75 pHeight = unsafePerformIO (readIORef pHeightRef)
+   76 
+   77 setHeight :: Height -> IO ()
+   78 setHeight = writeIORef pHeightRef
+   79 
+   80 {-# NOINLINE pNoExternalsRef #-}
+   81 pNoExternalsRef :: IORef Bool
+   82 pNoExternalsRef = unsafePerformIO (newIORef False)
+   83 
+   84 {-# NOINLINE pNoExternals #-}
+   85 pNoExternals :: Bool
+   86 pNoExternals = unsafePerformIO (readIORef pNoExternalsRef)
+   87 
+   88 setNoExternals :: Bool -> IO ()
+   89 setNoExternals = writeIORef pNoExternalsRef
    90 
-   91 -- | Set desired height of animation in pixel.
-   92 setHeight :: Height -> IO ()
-   93 setHeight = writeIORef pHeightRef
+   91 {-# NOINLINE pRootDirectoryRef #-}
+   92 pRootDirectoryRef :: IORef FilePath
+   93 pRootDirectoryRef = unsafePerformIO (newIORef (error "root directory not set"))
    94 
-   95 {-# NOINLINE pNoExternalsRef #-}
-   96 pNoExternalsRef :: IORef Bool
-   97 pNoExternalsRef = unsafePerformIO (newIORef False)
+   95 {-# NOINLINE pRootDirectory #-}
+   96 pRootDirectory :: FilePath
+   97 pRootDirectory = unsafePerformIO (readIORef pRootDirectoryRef)
    98 
-   99 {-# NOINLINE pNoExternals #-}
-  100 -- | This parameter determined whether or not external tools are allowed.
-  101 --   If this flag is True then tools such as 'latex' and 'blender' will not
-  102 --   be invoked.
-  103 pNoExternals :: Bool
-  104 pNoExternals = unsafePerformIO (readIORef pNoExternalsRef)
-  105 
-  106 -- | Set whether external tools are allowed.
-  107 setNoExternals :: Bool -> IO ()
-  108 setNoExternals = writeIORef pNoExternalsRef
-  109 
-  110 {-# NOINLINE pRootDirectoryRef #-}
-  111 pRootDirectoryRef :: IORef FilePath
-  112 pRootDirectoryRef = unsafePerformIO (newIORef (error "root directory not set"))
-  113 
-  114 {-# NOINLINE pRootDirectory #-}
-  115 -- | Root directory of animation. Images and other data has to be placed
-  116 --   here if they are referenced in an SVG image.
-  117 pRootDirectory :: FilePath
-  118 pRootDirectory = unsafePerformIO (readIORef pRootDirectoryRef)
-  119 
-  120 -- | Set the root animation directory.
-  121 setRootDirectory :: FilePath -> IO ()
-  122 setRootDirectory = writeIORef pRootDirectoryRef
+   99 setRootDirectory :: FilePath -> IO ()
+  100 setRootDirectory = writeIORef pRootDirectoryRef