Socket
Socket
Sign inDemoInstall

@pixi/filter-color-gradient

Package Overview
Dependencies
32
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pixi/filter-color-gradient

PixiJS filter to render a color gradient.


Version published
Weekly downloads
2.4K
decreased by-50.47%
Maintainers
2
Install size
164 kB
Created
Weekly downloads
 

Readme

Source

ColorGradientFilter

PixiJS filter to render a color gradient.

View demo

Installation

npm install @pixi/filter-color-gradient

Usage

import { ColorGradientFilter } from '@pixi/filter-color-gradient';
import { Container } from 'pixi.js';

const container = new Container();

const options = {
  type: ColorGradientFilter.LINEAR,
  stops: [
    { offset: 0.0, color: 'red', alpha: 1.0, },
    { offset: 1.0, color: 'blue', alpha: 1.0, },
  ],
  angle: 90,
  alpha: 0.8,
}

container.filters = [new ColorGradientFilter(options)];

Color values

The following values can be used to define a color.

DescriptionTypeExample
CSS color namestring"red"
Hexadecimal stringstring"#ff0000", "#f00"
Hexadecimal numbernumber0xff0000
Array of numbers [R,G,B]number[][1.0, 0.0, 0.0]

Documentation

See https://filters.pixijs.download/main/docs/ColorGradientFilter.html

FAQs

Last updated on 15 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc