Gleam-0.1.1.0: HTML Canvas graphics, animations and simulations.

Safe HaskellSafe
LanguageHaskell2010

Picture

Contents

Synopsis

Documentation

data Picture Source #

A 2D picture.

Constructors

Blank

A blank picture, with nothing in it.

Line Path

A line along an arbitrary path.

Polygon Path

A polygon filled with a solid color.

Circle Double

A circle with the given radius.

Arc Double Double Double

A circular arc drawn counter-clockwise between two angles (in degrees) at the given radius.

Rectangle Double Double

A rectangle drawn with given width and height.

Image Source Double Double

Image to draw from a certain with given width and height.

Text String Font FontSize

Some text to draw with a vector font.

Color Color Picture

A picture drawn with this color.

Stroke Color Double Picture

A picture drawn with this stroke, given a color and size.

Translate Double Double Picture

A picture translated by the given x and y coordinates.

Scale Double Double Picture

A picture scaled by the given x and y factors.

Pictures [Picture]

A picture consisting of several others.

Instances

Eq Picture Source # 

Methods

(==) :: Picture -> Picture -> Bool

(/=) :: Picture -> Picture -> Bool

Show Picture Source # 

Methods

showsPrec :: Int -> Picture -> ShowS

show :: Picture -> String

showList :: [Picture] -> ShowS

Semigroup Picture Source # 

Methods

(<>) :: Picture -> Picture -> Picture

sconcat :: NonEmpty Picture -> Picture

stimes :: Integral b => b -> Picture -> Picture

Monoid Picture Source # 

type Point = (Double, Double) Source #

A point on the x-y plane.

type Vector = Point Source #

A vector can be treated as a point, and vis-versa.

type Path = [Point] Source #

A path through the x-y plane.

data Source Source #

An image location

Constructors

File String

Path to an image inside ./images.

Url String

An image url.

Instances

Eq Source Source # 

Methods

(==) :: Source -> Source -> Bool

(/=) :: Source -> Source -> Bool

Show Source Source # 

Methods

showsPrec :: Int -> Source -> ShowS

show :: Source -> String

showList :: [Source] -> ShowS

Compound shapes

lineLoop :: Path -> Picture Source #

A closed loop along a path.

sectorWire :: Double -> Double -> Double -> Picture Source #

A wireframe sector of a circle. An arc is draw counter-clockwise from the first to the second angle at the given radius.

rectanglePath Source #

Arguments

:: Double

width of rectangle

-> Double

height of rectangle

-> Path 

A path representing a rectangle centered about the origin

rectangleWire :: Double -> Double -> Picture Source #

A wireframe rectangle centered about the origin.

rectangleSolid Source #

Arguments

:: Double

width of rectangle

-> Double

height of rectangle

-> Picture 

A solid rectangle centered about the origin.