Skip to content

Instantly share code, notes, and snippets.

@treeform
Created June 16, 2020 05:35
Show Gist options
  • Save treeform/260e4c5318353937e40c897e706c56b6 to your computer and use it in GitHub Desktop.
Save treeform/260e4c5318353937e40c897e706c56b6 to your computer and use it in GitHub Desktop.
import fidget, flippy, chroma
var f = newImage(400, 400, 4)
for x in 0 ..< 400:
for y in 0 ..< 400:
f.putRgba(x, y, hsl(x.float/400*360, y.float/400*100, 75).color.rgba)
f.save("data/generated.png")
setTitle("Image viewer")
proc drawMain() =
group "image":
box 0, 0, 400, 400
image "generated.png"
startFidget(drawMain, w = 400, h = 400)
@treeform
Copy link
Author

Here is how it looks:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment