@pixi/text
Advanced tools
Comparing version 7.1.2 to 7.2.0-beta
/** | ||
* Constants that define the type of gradient on text. | ||
* @static | ||
* @name TEXT_GRADIENT | ||
* @memberof PIXI | ||
* @type {object} | ||
* @property {number} LINEAR_VERTICAL Vertical gradient | ||
* @property {number} LINEAR_HORIZONTAL Linear gradient | ||
*/ | ||
export declare enum TEXT_GRADIENT { | ||
/** | ||
* Vertical gradient | ||
* @default 0 | ||
*/ | ||
LINEAR_VERTICAL = 0, | ||
/** | ||
* Linear gradient | ||
* @default 1 | ||
*/ | ||
LINEAR_HORIZONTAL = 1 | ||
} |
@@ -90,6 +90,5 @@ 'use strict'; | ||
const dropShadowColor = style.dropShadowColor; | ||
const rgb = core.utils.hex2rgb(typeof dropShadowColor === "number" ? dropShadowColor : core.utils.string2hex(dropShadowColor)); | ||
const dropShadowBlur = style.dropShadowBlur * this._resolution; | ||
const dropShadowDistance = style.dropShadowDistance * this._resolution; | ||
context.shadowColor = `rgba(${rgb[0] * 255},${rgb[1] * 255},${rgb[2] * 255},${style.dropShadowAlpha})`; | ||
context.shadowColor = core.Color.shared.setValue(dropShadowColor).setAlpha(style.dropShadowAlpha).toRgbaString(); | ||
context.shadowBlur = dropShadowBlur; | ||
@@ -96,0 +95,0 @@ context.shadowOffsetX = Math.cos(style.dropShadowAngle) * dropShadowDistance; |
@@ -342,20 +342,8 @@ 'use strict'; | ||
}; | ||
function getSingleColor(color) { | ||
if (typeof color === "number") { | ||
return core.utils.hex2string(color); | ||
} else if (typeof color === "string") { | ||
if (color.startsWith("0x")) { | ||
color = color.replace("0x", "#"); | ||
} | ||
} | ||
return color; | ||
} | ||
function getColor(color) { | ||
const temp = core.Color.shared; | ||
if (!Array.isArray(color)) { | ||
return getSingleColor(color); | ||
return temp.setValue(color).toHex(); | ||
} else { | ||
for (let i = 0; i < color.length; ++i) { | ||
color[i] = getSingleColor(color[i]); | ||
} | ||
return color; | ||
return color.map((c) => temp.setValue(c).toHex()); | ||
} | ||
@@ -362,0 +350,0 @@ } |
{ | ||
"name": "@pixi/text", | ||
"version": "7.1.2", | ||
"version": "7.2.0-beta", | ||
"main": "lib/index.js", | ||
@@ -41,4 +41,3 @@ "module": "lib/index.mjs", | ||
"@pixi/sprite" | ||
], | ||
"gitHead": "27e65c73bb36a06fd00d6da5bf460bbee9f6c984" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
364494
3082
1