Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Coordinate

Coordinate: { x: number; y: number }

A simple coordinate type.

Type declaration

  • x: number
  • y: number

Functions

RGBToHex

  • RGBToHex(r: number, g: number, b: number): string
  • Takes an RGB value and returns a Hex string.

    Parameters

    • r: number

      Red value.

    • g: number

      Green value.

    • b: number

      Blue value.

    Returns string

    Hexadecimal string (e.g. '#ff66ff')

assignViewToModule

  • Creates a view out of a model.

    Parameters

    Returns ModuleViewController | undefined

    The ModuleViewController for the ModuleModel.

clip

  • clip(num: number, min: number, max: number): number
  • Clip a number. E.g. defining the bounds to be [0,1]: [0.5 => 0.5], [1.0 => 1.0], [1.3 => 1.0]

    Parameters

    • num: number

      The number that has to be clipped.

    • min: number

      Lower boundary value.

    • max: number

      Upper boundaty value.

    Returns number

getRGBFromImgPos

  • getRGBFromImgPos(x: number, y: number, width: number, height: number, imgData: any): [number, number, number]
  • Takes an image position and return the color value at that point.

    Parameters

    • x: number

      Horizontal position in px.

    • y: number

      Vertical position in px.

    • width: number

      Image width.

    • height: number

      Image height.

    • imgData: any

      ImgData that is returned from a 2d canvas.

    Returns [number, number, number]

    An array of 3 values [R, G, B].

getTouchOffsets

  • Sometimes needed for touch events, to correctly calculate the on-screen position in px.

    Parameters

    • e: TouchEvent

      The TouchEvent that has to be modified.

    Returns Coordinate

    A coordinate with the correct touchpoint as on-screen px value.

Generated using TypeDoc