Skip to content

Instantly share code, notes, and snippets.

@bagedevimo
Created November 5, 2017 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bagedevimo/5ce2e978a6703d5b660a7967dbe285e2 to your computer and use it in GitHub Desktop.
Save bagedevimo/5ce2e978a6703d5b660a7967dbe285e2 to your computer and use it in GitHub Desktop.
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