elm-graphics
elm-graphics copied to clipboard
Runtime error from `Collage.gradient` given "illegal" `Color.linear` gradient
With "elm-lang/core": "4.0.5"
and "evancz/elm-graphics": "1.0.0"
, the following program results in a runtime error:
import Color
import Collage
import Element
grad =
Color.linear
( 0, 60 )
( 0, -60 )
[ ( 0, Color.white )
, ( 2, Color.black )
]
main =
Element.toHtml <|
Collage.collage
120
120
[ Collage.gradient grad (Collage.rect 120 120)
]
If one replaces the 2
in grad
by something between 0
and 1
, the program functions correctly.
It's not unlikely that something similar would happen with Color.radial
gradients.