Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
@pixi/filter-alpha
Advanced tools
Filter that applies alpha evenly across the entire display object and any opaque elements it contains
@pixi/filter-alpha is a filter for the PixiJS library that allows you to adjust the alpha (transparency) of display objects. This can be useful for creating fade effects, highlighting, or other visual effects that require changing the transparency of elements in a PixiJS application.
Adjusting Alpha Transparency
This code sample demonstrates how to apply an alpha filter to a sprite in a PixiJS application. The AlphaFilter is set to 0.5, making the sprite 50% transparent.
const app = new PIXI.Application();
document.body.appendChild(app.view);
const sprite = PIXI.Sprite.from('path/to/image.png');
app.stage.addChild(sprite);
const alphaFilter = new PIXI.filters.AlphaFilter(0.5);
sprite.filters = [alphaFilter];
pixi-filters is a collection of filters for PixiJS, including various effects like blur, color adjustment, and more. While @pixi/filter-alpha focuses specifically on alpha transparency, pixi-filters offers a broader range of visual effects, making it a more comprehensive solution for developers looking to apply multiple types of filters.
pixi.js is the core library for rendering 2D graphics in the browser. It includes basic functionality for rendering and manipulating graphics, including setting alpha transparency directly on display objects. However, @pixi/filter-alpha provides a more flexible and reusable way to manage transparency effects through filters.
npm install @pixi/filter-alpha
import '@pixi/filter-alpha';
FAQs
Filter that applies alpha evenly across the entire display object and any opaque elements it contains
The npm package @pixi/filter-alpha receives a total of 111,780 weekly downloads. As such, @pixi/filter-alpha popularity was classified as popular.
We found that @pixi/filter-alpha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.