Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active August 18, 2023 07:30
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 dacr/a02fbef05c773bafe9ed55cce73388d2 to your computer and use it in GitHub Desktop.
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
// 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