mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 14:40:38 +00:00
22 lines
809 B
JavaScript
22 lines
809 B
JavaScript
var Overlay = require('./Overlay');
|
|
|
|
/**
|
|
* Multiplies or screens the colors, depending on the source color value.
|
|
*
|
|
* If the source color is lighter than 0.5, the backdrop is lightened, as if it were screened;
|
|
* this is useful for adding highlights to a scene.
|
|
*
|
|
* If the source color is darker than 0.5, the backdrop is darkened, as if it were multiplied;
|
|
* this is useful for adding shadows to a scene.
|
|
*
|
|
* The degree of lightening or darkening is proportional to the difference between the source color and 0.5;
|
|
* if it is equal to 0.5, the backdrop is unchanged.
|
|
*
|
|
* Painting with pure black or white produces pure black or white. The effect is similar to shining a harsh spotlight on the backdrop.
|
|
*/
|
|
var HardLight = function (a, b)
|
|
{
|
|
return Overlay(b, a);
|
|
};
|
|
|
|
module.exports = HardLight;
|