Last active
May 25, 2024 10:20
-
-
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/680597242175c88b77e953b5cbe35d4b186f1b51
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.4.2" | |
//> 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