diff --git a/packages/constants/src/index.js b/packages/constants/src/index.js index 366f4a3..f06f4a5 100644 --- a/packages/constants/src/index.js +++ b/packages/constants/src/index.js @@ -59,6 +59,10 @@ * @property {number} SATURATION * @property {number} COLOR * @property {number} LUMINOSITY + * @property {number} NORMAL_NPM + * @property {number} ADD_NPM + * @property {number} SCREEN_NPM + * @property {number} NONE */ export const BLEND_MODES = { NORMAL: 0, @@ -81,6 +85,7 @@ NORMAL_NPM: 17, ADD_NPM: 18, SCREEN_NPM: 19, + NONE: 20, }; /** diff --git a/packages/constants/src/index.js b/packages/constants/src/index.js index 366f4a3..f06f4a5 100644 --- a/packages/constants/src/index.js +++ b/packages/constants/src/index.js @@ -59,6 +59,10 @@ * @property {number} SATURATION * @property {number} COLOR * @property {number} LUMINOSITY + * @property {number} NORMAL_NPM + * @property {number} ADD_NPM + * @property {number} SCREEN_NPM + * @property {number} NONE */ export const BLEND_MODES = { NORMAL: 0, @@ -81,6 +85,7 @@ NORMAL_NPM: 17, ADD_NPM: 18, SCREEN_NPM: 19, + NONE: 20, }; /** diff --git a/packages/core/src/state/State.js b/packages/core/src/state/State.js index 6e5673d..c87e268 100644 --- a/packages/core/src/state/State.js +++ b/packages/core/src/state/State.js @@ -1,3 +1,5 @@ +import { BLEND_MODES } from '@pixi/constants'; + /* eslint-disable max-len */ const BLEND = 0; @@ -21,7 +23,7 @@ { this.data = 0; - this.blendMode = 0; + this.blendMode = BLEND_MODES.NORMAL; this.polygonOffset = 0; this.blend = true; @@ -136,8 +138,7 @@ set blendMode(value) // eslint-disable-line require-jsdoc { - // 17 is NO BLEND - this.blend = (value !== 17); + this.blend = (value !== BLEND_MODES.NONE); this._blendMode = value; }