Home Reference Source
public class | source

Border

Extends:

Division → Border

Border pattern.

Constructor Summary

Public Constructor
public

constructor(color: string, borderWidth: number)

Creates Border.

Member Summary

Public Members
public

Method Summary

Public Methods
public

draw(ctx: object)

Draws the Border pattern on a canvas.

Inherited Summary

From class Division
public

color: *

public

count: *

public

limit: *

public

seed: *

public

Public Constructors

public constructor(color: string, borderWidth: number) source

Creates Border.

Override:

Division#constructor

Params:

NameTypeAttributeDescription
color string

A hex color value.

borderWidth number

A number representing the size of the border. This is used for coordinate drawing on a canvas for now.

Example:

// Instantiates a Border
const border = new Border(20);

TODO:

  • Handle border width more elegantly than taking a flat value from the caller.

Public Members

public borderWidth: * source

Public Methods

public draw(ctx: object) source

Draws the Border pattern on a canvas.

Params:

NameTypeAttributeDescription
ctx object

An object containing a canvas context.

Example:

// Draws the Border pattern.
border.draw(ctx);