Last active
August 18, 2023 07:30
-
-
Save dacr/a02fbef05c773bafe9ed55cce73388d2 to your computer and use it in GitHub Desktop.
Drawing again circles using doodle library. / published by https://github.com/dacr/code-examples-manager #9adf4ea7-deb6-4ef9-81db-e05253d31a31/876566aecc8e0acf4bee8eb4538913171f770620
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
// summary : Drawing again circles using doodle library. | |
// keywords : scala, vector-graphics, doodle | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : 9adf4ea7-deb6-4ef9-81db-e05253d31a31 | |
// created-on : 2019-06-27T20:12:07Z | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// run-with : scala-cli $file | |
// --------------------- | |
//> using scala "3.3.0" | |
//> using dep "org.creativescala::doodle:0.20.0" | |
// --------------------- | |
import doodle.core.* | |
import doodle.image.* | |
import doodle.syntax.all.* | |
import doodle.image.syntax.all.* | |
import doodle.java2d.* | |
import cats.effect.unsafe.implicits.global | |
val circles = | |
(0 to 360 by 15) | |
.map { x => | |
Image | |
.circle(50) | |
.fillColor(Color.hsl(x.degrees, 0.7, 0.7)) | |
.at(Point(200, x.degrees)) | |
} | |
.reduce((i1, i2) => i1.on(i2)) | |
circles.draw() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment