Last active
September 28, 2024 08:58
-
-
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/8de3ace63e0cd5d2445bb64eaf909b0e7e215b13
This file contains hidden or 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.5.1" | |
//> using dep "org.creativescala::doodle:0.25.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