BitmapData#shiftHSL()

shiftHSL(h, s, l, region) → {Phaser.BitmapData}

Shifts any or all of the hue, saturation and lightness values on every pixel in the given region, or the whole BitmapData if no region was specified.
Shifting will add the given value onto the current h, s and l values, not replace them.
The hue is wrapped to keep it within the range 0 to 1. Saturation and lightness are clamped to not exceed 1.

Parameters
Name Type Argument Default Description
h number <optional>
null

The amount to shift the hue by.

s number <optional>
null

The amount to shift the saturation by.

l number <optional>
null

The amount to shift the lightness by.

region Phaser.Rectangle <optional>

The area to perform the operation on. If not given it will run over the whole BitmapData.

Returns

This BitmapData object for method chaining.

Source code: gameobjects/BitmapData.js (Line 865)
doc_phaser
2017-02-14 10:37:15
Comments
Leave a Comment

Please login to continue.