Skip to content
Christopher Nikkel edited this page Dec 23, 2018 · 2 revisions

Pen

Definition

type Pen =
    {
        Color: Color;
        Opacity: float option;
        Width: Length option;
    }

Description

Pen is used to specify the color, opacity, and width for styles. It uses Color and Length to describe its attributes.

Constants

Constant Type Description
Pen.red Pen a red Pen
Pen.green Pen a green Pen
Pen.blue Pen a blue Pen
Pen.black Pen a black Pen
Pen.gray Pen a gray Pen
Pen.white Pen a white Pen
Pen.yellow Pen a yellow Pen
Pen.purple Pen a purple Pen
Pen.orange Pen an orange Pen

Functions

Function Signature Description
Pen.create Color -> Pen creates a Pen with the specified Color
createWithOpacity Color -> float -> Pen creates a Pen with the specified Color and opacity
createWithWidth Length -> Pen creates a Pen with the specified width as a Length
createWithOpacityAndWidth float -> Length -> Pen creates a Pen with the specified Color, opacity, and width as a Length
withOpacity float -> Pen -> Pen adds an opacity to a Pen
withWidth Length -> Pen -> Pen adds width to a Pen

Usage

Example

let pen1 =
  Pen.createWithOpacityAndWidth (Color.ofName Colors.Aqua) 5.0 Length.one

Table of Contents

Getting Started

Fundamentals

Basic SVG Elements

Advanced Elements

Experimental

Clone this wiki locally