API Docs for:
Show:

gs.Tone Class

Describes a color tone used to tint a graphic object or a screen.

Constructor

gs.Tone

(
  • red|tone
  • [green=null]
  • [blue=null]
  • [grey=null]
)

Parameters:

  • red|tone Number | gs.Tone
    • The tone's red-value OR a tone-object to copy values from.
  • [green=null] Number optional
    • The tone's green-value.
  • [blue=null] Number optional
    • The tone's blue-value.
  • [grey=null] Number optional
    • The tone's grey-value.

Item Index

Methods

Properties

Methods

fromArray

(
  • a
)
gs.Tone static

Creates a new tone from the specified tone-value array. The should have 4 elements with the red, green, blue and grey tone-values in that order.

Parameters:

  • a Number
    • An array of tone-values.

Returns:

gs.Tone:

A new created tone with the specified tone-values.

fromObject

(
  • o
)
gs.Tone static

Creates a tone from an raw object. The object should contain 4 properties named red, green, blue and grey.

Parameters:

  • o Object
    • The object with the red, green, blue and grey properties of the tone.

Returns:

gs.Tone:

The new created tone.

set

(
  • red|tone
  • [green=null]
  • [blue=null]
  • [grey=null]
)

Sets the color-values of the tone.

Parameters:

  • red|tone Number | gs.Tone
    • The tone's red-value OR a tone-object to copy values from.
  • [green=null] Number optional
    • The tone's green-value.
  • [blue=null] Number optional
    • The tone's blue-value.
  • [grey=null] Number optional
    • The tone's grey-value.

Properties

blue

Number

The tone's blue-value.

green

Number

The tone's green-value.

grey

Number

The tone's grey-value.

NORMAL

gs.Tone final static

Normal tone. No tinting is executed using this tone.

red

Number

The tone's red-value.