SMILe

SMILe draws pictures from Scala, on the JVM with Java2D and in a browser with canvas and SVG.

Everything drawn is an smile.pictures.Element, which is a shape, a text, a bitmap, an SVG picture, or a smile.pictures.Picture of several. Elements are immutable. Transforming or combining them gives new elements.

import smile.colors.Color
import smile.modeling.Pos
import smile.pictures.*

val sun   = Circle(Pos.Origin, 40, fillWith(Color(255, 200, 0)), None)
val house = Rectangle(120, 80, fillWith(Color(200, 80, 60)), None)
val scene = house.addToTop(sun, gap = 10)

A yellow circle above a red rectangle

Where to look:

Attributes

Members list

Packages

package smile