Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:19
Show Gist options
  • Select an option

  • Save dacr/a02fbef05c773bafe9ed55cce73388d2 to your computer and use it in GitHub Desktop.

Select an option

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/584917dcf9bf0128dd936ed2f59c3e710ee6f853
// summary : Drawing again circles using doodle library.
// keywords : scala, vector-graphics, doodle
// publish : gist
// authors : David Crosson
// license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
// 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