Home Reference Source
public class | source

Fesses

Extends:

Division → Fesses

Fesses pattern.

Constructor Summary

Public Constructor
public

constructor(gapPercentage: number, color: string)

Create fesses.

Member Summary

Public Members
public

Method Summary

Public Methods
public

draw(ctx: object, containerWidth: number, gapPercentage: number)

Draw Fesses on a canvas.

Inherited Summary

From class Division
public

color: *

public

count: *

public

limit: *

public

seed: *

public

Public Constructors

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

Create fesses.

Override:

Division#constructor

Params:

NameTypeAttributeDescription
gapPercentage number

A whole number representing a percentage of the containerWidth. Used to place gaps during draw time.

color string

A hexadecimal color string.

Example:

// Returns a Fesses instance.
const fesses = new Fesses(2, '#3febeb');

TODO:

  • Switch up the draw function to use draw instructions in the same way as the Pall division.

Public Members

public gapPercentage: * source

Public Methods

public draw(ctx: object, containerWidth: number, gapPercentage: number) source

Draw Fesses on a canvas.

Params:

NameTypeAttributeDescription
ctx object

A canvas Context.

containerWidth number

The width of the area on which to draw Fesses.

gapPercentage number

A whole number representing a percentage of the containerWidth.

Example:

// Draws a Fesses instance on a canvas.
fesses.drawFesses(ctx, 500);

TODO:

  • The gapPercentage cannot exceed a certain value, but I don't know how to calculate a stop. Keep it below 20. It's probably something like: the gap percentage cannot exceed a certain value based on the number of gaps.