@pixi-essentials/gradients
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "0.0.2", | ||
"tag": "@pixi-essentials/gradients_v0.0.2", | ||
"date": "Sat, 26 Dec 2020 22:47:29 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Upgrade to PixiJS 5.4.0 RC and generate a index.d.ts file." | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "0.0.1", | ||
@@ -7,0 +19,0 @@ "tag": "@pixi-essentials/gradients_v0.0.1", |
# Change Log - @pixi-essentials/gradients | ||
This log was last generated on Sat, 03 Oct 2020 01:37:43 GMT and should not be manually modified. | ||
This log was last generated on Sat, 26 Dec 2020 22:47:29 GMT and should not be manually modified. | ||
## 0.0.2 | ||
Sat, 26 Dec 2020 22:47:29 GMT | ||
### Patches | ||
- Upgrade to PixiJS 5.4.0 RC and generate a index.d.ts file. | ||
## 0.0.1 | ||
@@ -6,0 +13,0 @@ Sat, 03 Oct 2020 01:37:43 GMT |
/* eslint-disable */ | ||
/*! | ||
* @pixi-essentials/gradients - v0.0.1-alpha.0 | ||
* Compiled Sat, 03 Oct 2020 01:36:39 UTC | ||
* @pixi-essentials/gradients - v0.0.1 | ||
* Compiled Sat, 26 Dec 2020 22:14:07 UTC | ||
* | ||
@@ -26,14 +26,16 @@ * @pixi-essentials/gradients is licensed under the MIT License. | ||
function cssColor(color) { | ||
let string = color.toString(16); | ||
var string = color.toString(16); | ||
while (string.length < 6) { | ||
string = `0${string}`; | ||
string = "0" + string; | ||
} | ||
return `#${string}`; | ||
return "#" + string; | ||
} | ||
const tempSourceFrame = new math.Rectangle(); | ||
const tempDestinationFrame = new math.Rectangle(); | ||
var tempSourceFrame = new math.Rectangle(); | ||
var tempDestinationFrame = new math.Rectangle(); | ||
/** | ||
* Factory class for generating color-gradient textures. | ||
*/ | ||
class GradientFactory { | ||
var GradientFactory = /** @class */ (function () { | ||
function GradientFactory() { | ||
} | ||
/** | ||
@@ -58,10 +60,10 @@ * Renders a linear-gradient into `renderTexture` that starts from (x0, y0) and ends at (x1, y1). These | ||
*/ | ||
static createLinearGradient(renderer, renderTexture, options) { | ||
const { x0, y0, x1, y1, colorStops } = options; | ||
const canvas = document.createElement('canvas'); | ||
GradientFactory.createLinearGradient = function (renderer, renderTexture, options) { | ||
var x0 = options.x0, y0 = options.y0, x1 = options.x1, y1 = options.y1, colorStops = options.colorStops; | ||
var canvas = document.createElement('canvas'); | ||
canvas.width = renderTexture.width; | ||
canvas.height = renderTexture.height; | ||
const context = canvas.getContext('2d'); | ||
const gradient = context.createLinearGradient(x0, y0, x1, y1); | ||
colorStops.forEach((stop) => { | ||
var context = canvas.getContext('2d'); | ||
var gradient = context.createLinearGradient(x0, y0, x1, y1); | ||
colorStops.forEach(function (stop) { | ||
gradient.addColorStop(stop.offset, cssColor(stop.color)); | ||
@@ -72,6 +74,6 @@ }); | ||
// Store the current render-texture binding. | ||
const renderTarget = renderer.renderTexture.current; | ||
const sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
const destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
const renderSprite = new sprite.Sprite(core.Texture.from(canvas)); | ||
var renderTarget = renderer.renderTexture.current; | ||
var sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
var destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
var renderSprite = new sprite.Sprite(core.Texture.from(canvas)); | ||
renderer.batch.flush(); | ||
@@ -83,3 +85,3 @@ renderer.renderTexture.bind(renderTexture); | ||
return renderTexture; | ||
} | ||
}; | ||
/** | ||
@@ -104,10 +106,10 @@ * Renders a radial-gradient into `renderTexture` that starts at the circle centered at (x0, y0) of radius r0 and | ||
*/ | ||
static createRadialGradient(renderer, renderTexture, options) { | ||
const { x0, y0, r0, x1, y1, r1, colorStops } = options; | ||
const canvas = document.createElement('canvas'); | ||
GradientFactory.createRadialGradient = function (renderer, renderTexture, options) { | ||
var x0 = options.x0, y0 = options.y0, r0 = options.r0, x1 = options.x1, y1 = options.y1, r1 = options.r1, colorStops = options.colorStops; | ||
var canvas = document.createElement('canvas'); | ||
canvas.width = renderTexture.width; | ||
canvas.height = renderTexture.height; | ||
const context = canvas.getContext('2d'); | ||
const gradient = context.createRadialGradient(x0, y0, r0, x1, y1, r1); | ||
colorStops.forEach((stop) => { | ||
var context = canvas.getContext('2d'); | ||
var gradient = context.createRadialGradient(x0, y0, r0, x1, y1, r1); | ||
colorStops.forEach(function (stop) { | ||
gradient.addColorStop(stop.offset, cssColor(stop.color)); | ||
@@ -118,6 +120,6 @@ }); | ||
// Store the current render-texture binding. | ||
const renderTarget = renderer.renderTexture.current; | ||
const sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
const destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
const renderSprite = new sprite.Sprite(core.Texture.from(canvas)); | ||
var renderTarget = renderer.renderTexture.current; | ||
var sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
var destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
var renderSprite = new sprite.Sprite(core.Texture.from(canvas)); | ||
renderer.batch.flush(); | ||
@@ -129,4 +131,5 @@ renderer.renderTexture.bind(renderTexture); | ||
return renderTexture; | ||
} | ||
} | ||
}; | ||
return GradientFactory; | ||
}()); | ||
@@ -133,0 +136,0 @@ exports.GradientFactory = GradientFactory; |
/* eslint-disable */ | ||
/*! | ||
* @pixi-essentials/gradients - v0.0.1-alpha.0 | ||
* Compiled Sat, 03 Oct 2020 01:36:39 UTC | ||
* @pixi-essentials/gradients - v0.0.1 | ||
* Compiled Sat, 26 Dec 2020 22:14:07 UTC | ||
* | ||
@@ -23,14 +23,16 @@ * @pixi-essentials/gradients is licensed under the MIT License. | ||
function cssColor(color) { | ||
let string = color.toString(16); | ||
var string = color.toString(16); | ||
while (string.length < 6) { | ||
string = `0${string}`; | ||
string = "0" + string; | ||
} | ||
return `#${string}`; | ||
return "#" + string; | ||
} | ||
const tempSourceFrame = new Rectangle(); | ||
const tempDestinationFrame = new Rectangle(); | ||
var tempSourceFrame = new Rectangle(); | ||
var tempDestinationFrame = new Rectangle(); | ||
/** | ||
* Factory class for generating color-gradient textures. | ||
*/ | ||
class GradientFactory { | ||
var GradientFactory = /** @class */ (function () { | ||
function GradientFactory() { | ||
} | ||
/** | ||
@@ -55,10 +57,10 @@ * Renders a linear-gradient into `renderTexture` that starts from (x0, y0) and ends at (x1, y1). These | ||
*/ | ||
static createLinearGradient(renderer, renderTexture, options) { | ||
const { x0, y0, x1, y1, colorStops } = options; | ||
const canvas = document.createElement('canvas'); | ||
GradientFactory.createLinearGradient = function (renderer, renderTexture, options) { | ||
var x0 = options.x0, y0 = options.y0, x1 = options.x1, y1 = options.y1, colorStops = options.colorStops; | ||
var canvas = document.createElement('canvas'); | ||
canvas.width = renderTexture.width; | ||
canvas.height = renderTexture.height; | ||
const context = canvas.getContext('2d'); | ||
const gradient = context.createLinearGradient(x0, y0, x1, y1); | ||
colorStops.forEach((stop) => { | ||
var context = canvas.getContext('2d'); | ||
var gradient = context.createLinearGradient(x0, y0, x1, y1); | ||
colorStops.forEach(function (stop) { | ||
gradient.addColorStop(stop.offset, cssColor(stop.color)); | ||
@@ -69,6 +71,6 @@ }); | ||
// Store the current render-texture binding. | ||
const renderTarget = renderer.renderTexture.current; | ||
const sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
const destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
const renderSprite = new Sprite(Texture.from(canvas)); | ||
var renderTarget = renderer.renderTexture.current; | ||
var sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
var destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
var renderSprite = new Sprite(Texture.from(canvas)); | ||
renderer.batch.flush(); | ||
@@ -80,3 +82,3 @@ renderer.renderTexture.bind(renderTexture); | ||
return renderTexture; | ||
} | ||
}; | ||
/** | ||
@@ -101,10 +103,10 @@ * Renders a radial-gradient into `renderTexture` that starts at the circle centered at (x0, y0) of radius r0 and | ||
*/ | ||
static createRadialGradient(renderer, renderTexture, options) { | ||
const { x0, y0, r0, x1, y1, r1, colorStops } = options; | ||
const canvas = document.createElement('canvas'); | ||
GradientFactory.createRadialGradient = function (renderer, renderTexture, options) { | ||
var x0 = options.x0, y0 = options.y0, r0 = options.r0, x1 = options.x1, y1 = options.y1, r1 = options.r1, colorStops = options.colorStops; | ||
var canvas = document.createElement('canvas'); | ||
canvas.width = renderTexture.width; | ||
canvas.height = renderTexture.height; | ||
const context = canvas.getContext('2d'); | ||
const gradient = context.createRadialGradient(x0, y0, r0, x1, y1, r1); | ||
colorStops.forEach((stop) => { | ||
var context = canvas.getContext('2d'); | ||
var gradient = context.createRadialGradient(x0, y0, r0, x1, y1, r1); | ||
colorStops.forEach(function (stop) { | ||
gradient.addColorStop(stop.offset, cssColor(stop.color)); | ||
@@ -115,6 +117,6 @@ }); | ||
// Store the current render-texture binding. | ||
const renderTarget = renderer.renderTexture.current; | ||
const sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
const destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
const renderSprite = new Sprite(Texture.from(canvas)); | ||
var renderTarget = renderer.renderTexture.current; | ||
var sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
var destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
var renderSprite = new Sprite(Texture.from(canvas)); | ||
renderer.batch.flush(); | ||
@@ -126,6 +128,7 @@ renderer.renderTexture.bind(renderTexture); | ||
return renderTexture; | ||
} | ||
} | ||
}; | ||
return GradientFactory; | ||
}()); | ||
export { GradientFactory }; | ||
//# sourceMappingURL=gradients.es.js.map |
/* eslint-disable */ | ||
/*! | ||
* @pixi-essentials/gradients - v0.0.1-alpha.0 | ||
* Compiled Sat, 03 Oct 2020 01:36:39 UTC | ||
* @pixi-essentials/gradients - v0.0.1 | ||
* Compiled Sat, 26 Dec 2020 22:14:07 UTC | ||
* | ||
@@ -27,14 +27,16 @@ * @pixi-essentials/gradients is licensed under the MIT License. | ||
function cssColor(color) { | ||
let string = color.toString(16); | ||
var string = color.toString(16); | ||
while (string.length < 6) { | ||
string = `0${string}`; | ||
string = "0" + string; | ||
} | ||
return `#${string}`; | ||
return "#" + string; | ||
} | ||
const tempSourceFrame = new math.Rectangle(); | ||
const tempDestinationFrame = new math.Rectangle(); | ||
var tempSourceFrame = new math.Rectangle(); | ||
var tempDestinationFrame = new math.Rectangle(); | ||
/** | ||
* Factory class for generating color-gradient textures. | ||
*/ | ||
class GradientFactory { | ||
var GradientFactory = /** @class */ (function () { | ||
function GradientFactory() { | ||
} | ||
/** | ||
@@ -59,10 +61,10 @@ * Renders a linear-gradient into `renderTexture` that starts from (x0, y0) and ends at (x1, y1). These | ||
*/ | ||
static createLinearGradient(renderer, renderTexture, options) { | ||
const { x0, y0, x1, y1, colorStops } = options; | ||
const canvas = document.createElement('canvas'); | ||
GradientFactory.createLinearGradient = function (renderer, renderTexture, options) { | ||
var x0 = options.x0, y0 = options.y0, x1 = options.x1, y1 = options.y1, colorStops = options.colorStops; | ||
var canvas = document.createElement('canvas'); | ||
canvas.width = renderTexture.width; | ||
canvas.height = renderTexture.height; | ||
const context = canvas.getContext('2d'); | ||
const gradient = context.createLinearGradient(x0, y0, x1, y1); | ||
colorStops.forEach((stop) => { | ||
var context = canvas.getContext('2d'); | ||
var gradient = context.createLinearGradient(x0, y0, x1, y1); | ||
colorStops.forEach(function (stop) { | ||
gradient.addColorStop(stop.offset, cssColor(stop.color)); | ||
@@ -73,6 +75,6 @@ }); | ||
// Store the current render-texture binding. | ||
const renderTarget = renderer.renderTexture.current; | ||
const sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
const destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
const renderSprite = new sprite.Sprite(core.Texture.from(canvas)); | ||
var renderTarget = renderer.renderTexture.current; | ||
var sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
var destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
var renderSprite = new sprite.Sprite(core.Texture.from(canvas)); | ||
renderer.batch.flush(); | ||
@@ -84,3 +86,3 @@ renderer.renderTexture.bind(renderTexture); | ||
return renderTexture; | ||
} | ||
}; | ||
/** | ||
@@ -105,10 +107,10 @@ * Renders a radial-gradient into `renderTexture` that starts at the circle centered at (x0, y0) of radius r0 and | ||
*/ | ||
static createRadialGradient(renderer, renderTexture, options) { | ||
const { x0, y0, r0, x1, y1, r1, colorStops } = options; | ||
const canvas = document.createElement('canvas'); | ||
GradientFactory.createRadialGradient = function (renderer, renderTexture, options) { | ||
var x0 = options.x0, y0 = options.y0, r0 = options.r0, x1 = options.x1, y1 = options.y1, r1 = options.r1, colorStops = options.colorStops; | ||
var canvas = document.createElement('canvas'); | ||
canvas.width = renderTexture.width; | ||
canvas.height = renderTexture.height; | ||
const context = canvas.getContext('2d'); | ||
const gradient = context.createRadialGradient(x0, y0, r0, x1, y1, r1); | ||
colorStops.forEach((stop) => { | ||
var context = canvas.getContext('2d'); | ||
var gradient = context.createRadialGradient(x0, y0, r0, x1, y1, r1); | ||
colorStops.forEach(function (stop) { | ||
gradient.addColorStop(stop.offset, cssColor(stop.color)); | ||
@@ -119,6 +121,6 @@ }); | ||
// Store the current render-texture binding. | ||
const renderTarget = renderer.renderTexture.current; | ||
const sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
const destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
const renderSprite = new sprite.Sprite(core.Texture.from(canvas)); | ||
var renderTarget = renderer.renderTexture.current; | ||
var sourceFrame = tempSourceFrame.copyFrom(renderer.renderTexture.sourceFrame); | ||
var destinationFrame = tempDestinationFrame.copyFrom(renderer.renderTexture.destinationFrame); | ||
var renderSprite = new sprite.Sprite(core.Texture.from(canvas)); | ||
renderer.batch.flush(); | ||
@@ -130,6 +132,7 @@ renderer.renderTexture.bind(renderTexture); | ||
return renderTexture; | ||
} | ||
} | ||
}; | ||
return GradientFactory; | ||
}()); | ||
exports.GradientFactory = GradientFactory; | ||
//# sourceMappingURL=gradients.js.map |
{ | ||
"name": "@pixi-essentials/gradients", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Generates textures with color gradients", | ||
@@ -8,5 +8,6 @@ "main": "lib/gradients.js", | ||
"bundle": "dist/gradients.js", | ||
"types": "./index.d.ts", | ||
"scripts": { | ||
"build": "rollup -c node_modules/@pixi-build-tools/rollup-configurator/index.js --silent", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"compile": "rm -rf compile && tsc && api-extractor run" | ||
}, | ||
@@ -37,13 +38,14 @@ "repository": { | ||
"peerDependencies": { | ||
"@pixi/core": "^5.3.3", | ||
"@pixi/math": "^5.3.3", | ||
"@pixi/sprite": "^5.3.3" | ||
"@pixi/core": "~5.4.0-rc.1", | ||
"@pixi/math": "~5.4.0-rc.1", | ||
"@pixi/sprite": "~5.4.0-rc.1" | ||
}, | ||
"devDependencies": { | ||
"@pixi/core": "^5.3.3", | ||
"@pixi/math": "^5.3.3", | ||
"@pixi/sprite": "^5.3.3", | ||
"@pixi/core": "~5.4.0-rc.1", | ||
"@pixi/math": "~5.4.0-rc.1", | ||
"@pixi/sprite": "~5.4.0-rc.1", | ||
"rollup": "^2.28.2", | ||
"@pixi-build-tools/rollup-configurator": "^1.0.5" | ||
"@pixi-build-tools/rollup-configurator": "^1.0.5", | ||
"typescript": "~4.1.3" | ||
} | ||
} |
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
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 tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
55298
11
478
1
6