Doodle: Compositional Vector Graphics

Copyright Noel Welsh.

Doodle is a Scala library for compositional vector graphics.

Distributed under the Apache 2.0 license.

Build Status

Using Doodle

The current release is 0.11.2 and is on the master branch.

To use doodle add the following to your build.sbt:

// Doodle is currently published for Scala 2.13 and Scala 3
libraryDependencies += "org.creativescala" %% "doodle" % "0.11.2"

Alternatively you can git clone or download Doodle and use it directly from the SBT console. See the instructions below.


Documentation is still a work-in-progress.

Creative Scala provides another source of documentation for Doodle. Creative Scala is a free introductory Scala ebook.

Below we have a few tips to get you started.

Getting Started from SBT

If you downloaded Doodle, rather than adding it to an existing Scala project, you can play around with it as follows.

  1. Start SBT:

    bash$ sbt
    > # This is the SBT prompt. Press Ctrl+D to quit to the OS.
  2. Start the console:

    > rootJVM/console
    scala> # This is the Scala prompt. Press Ctrl+D to quit to SBT.
  3. Use Scala commands to draw a shape in a native window:

    scala> (

    A window should appear containing a red circle.

  4. You can also save your masterpieces to a file.

    scala> ([Png]("masterpiece.png")

    Doodle currently supports writing to PNG, GIF, and JPG formats. Just alter the type parameter of write accordingly.

Attention IntelliJ Users

The Scala Plugin of IntelliJ still has an open bug which cannot resolve implicits correctly. The above example might give you an Error warning in Line XX. You can ignore this warning, or fix it using circle.draw[Algebra, Drawing, Frame, Canvas](). Please use any text editor and Metals to get a better experience using Doodle.


Doodle was written by Noel Welsh with contributions from the contributors listed by Github.


These are notes for developers.


To generate the documentation run the documentation task in SBT without changing to any project. If you do the task just seems to disappear. I have no idea why. The output will be in docs/target/docs. Copy this to the website and upload.

If you run out of metaspace you can run just the documentation task (i.e. sbt documentation) and it seems to be happier.


To publish a release:

  • update the version number on master in publish.sbt
  • update the version number in
  • run + clean ; compile ; publishSigned
  • run sonatypeBundleRelease
  • tag master with the release version
  • push tags to origin.