Created
November 5, 2017 09:25
-
-
Save bagedevimo/5ce2e978a6703d5b660a7967dbe285e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type alias Pixel = | |
{ red : Float | |
, blue : Float | |
, green : Float | |
, alpha : Float | |
} | |
type alias Image = | |
{ size : Size | |
, data : List (List Pixel) | |
} | |
type alias Size = | |
{ width : int | |
, height : int | |
} | |
defaultImage : Size -> Pixel -> Image | |
defaultImage size pixel = | |
repeat size.width (repeat size.height pixel) | |
|> (\imageData -> Image size imageData) | |
setPixel : Point -> Pixel -> Image -> Image | |
getPixel : Point -> Image -> Pixel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment