Reuse Reanimate.Builtin.Documentation.showColorMap

Former-commit-id: 66595c6d71ecda92c3fc8f55548ec9278a4863d5
This commit is contained in:
Jan Hrček 2019-12-10 17:37:25 +01:00 committed by David Himmelstrup
commit a16ba9e02f
12 changed files with 12 additions and 108 deletions

View file

@ -7,12 +7,4 @@ import Reanimate
import Reanimate.Builtin.Documentation
main :: IO ()
main = reanimate $ docEnv $ animate $ const $ mkColorMap jet
mkColorMap :: (Double -> PixelRGB8) -> SVG
mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img
where
width = 256
height = 1
img = generateImage pixelRenderer width height
pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1))
main = reanimate $ docEnv $ animate $ const $ showColorMap jet