shine-0.2.0.1: Declarative graphics for the browser using GHCJS

Copyright(c) Francesco Gazzetta 2016
LicenseMIT
Maintainerfrancygazz@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

Graphics.Shine.Picture

Description

This module contains the Picture datatype, used to represent the image to draw on the canvas, and some functions to operate on it.

Synopsis

Documentation

data Picture Source #

A drawable element. All Pictures are centered.

Constructors

Empty

The empty picture. Draws nothing.

Rect Double Double

A rectangle from the dimensions

RectF Double Double

Same thing but filled

Line Double Double Double Double

A line from the coordinates of two points

Polygon [(Double, Double)]

A polygon from a list of vertices

Arc Double Double Double Bool

An arc from the radius, start angle, end angle. If the last parameter is True, the direction is counterclockwise TODO replace with Clockwise | Counterclockwise or remove entirely

CircleF Double

A filled circle from the radius

Text Font TextAlignment (Maybe Double) String

Draws some text. The Maybe Double is the optional max width.

Image ImageSize ImageData

Draws an image

Over Picture Picture

Draws the second Picture over the first

Colored Color Picture

Applies the Color to the picture. Innermost colors have the precedence, so you can set a "global color" and override it

Rotate Double Picture

Rotates the Picture (in radians)

Translate Double Double Picture

Moves the Picture by the given x and y distances

Instances

Eq Picture Source # 

Methods

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

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

Show Picture Source # 
Monoid Picture Source #

Pictures are Monoids. The identity is an Empty (completely transparent) picture and the composing function is the overlapping (the right picture is drawn over the left one).

data Color Source #

A color given r, g, b (all from 0 to 255) and alpha (from 0 to 1)

Constructors

Color Int Int Int Float 

Instances

Eq Color Source # 

Methods

(==) :: Color -> Color -> Bool #

(/=) :: Color -> Color -> Bool #

Show Color Source # 

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

type Font = String Source #

Js-style font, ex. "12px Sans"

circle :: Double -> Picture Source #

A circle from the center coordinates and radius

path :: [(Double, Double)] -> Picture Source #

Shorthand to draw a series of lines

(<>) :: Monoid m => m -> m -> m infixr 6 #

An infix synonym for mappend.

Since: 4.5.0.0