pixijs-color

Convert and manipulate color values for PixiJS scenes.

302|15|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-color
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixijs-color
Source: https://github.com/pixijs/pixijs-skills/tree/main/skills/pixijs-color
Command: npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-color

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Color class provides a unified way to create, convert, and manipulate colors for tints, fills, strokes, and ColorSource-compatible APIs in PixiJS v8, simplifying color handling across the engine.

Core Features & Use Cases

  • Input formats: accepts hex numbers, hex strings, CSS color names, RGB/RGBA, HSL, and typed arrays, making it easy to convert colors from various sources.
  • Conversion methods: supports toHex, toNumber, toArray, toRgba, and more for seamless integration with shaders, textures, and DOM.
  • Manipulation and reuse: supports setAlpha, multiply, premultiply, and Color.shared for hot-path operations in real-time rendering.
  • Common helpers: isColorLike() as a type guard to validate inputs before constructing Color.

Quick Start

Create a new Color("#ff6600") and use toHex() or toNumber() in your rendering code.

Frequently Asked Questions about pixijs-color

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert hex strings to RGBA for PixiJS v8 rendering?

To convert hex strings to RGBA for PixiJS v8 rendering, use the Color class to instantiate a color and call conversion methods like toRgba or toArray. It accepts hex strings, numbers, and CSS names, returning the formatted output needed for consistent scene rendering.

What color formats are supported by the PixiJS v8 Color class?

The PixiJS v8 Color class supports hex numbers, hex strings, CSS color names, RGB/RGBA, HSL, and typed arrays. This allows you to easily parse and convert various input formats into a consistent source for tints, fills, and strokes.

Can I apply premultiplication and tinting to colors in PixiJS?

You can apply premultiplication and tinting to colors in PixiJS using the Color class manipulation methods. It provides built-in functions to premultiply or multiply color values, ensuring correct alpha blending and visual output during real-time rendering workflows.

Does PixiJS provide a way to validate color inputs before rendering?

PixiJS provides the isColorLike() helper function to validate color inputs before rendering. This type guard checks if an input is ColorSource-compatible, allowing you to safely verify data before constructing a new Color object for your scene.

What is the best way to handle color manipulation in hot-path rendering loops?

The best way to handle color manipulation in hot-path rendering loops is using Color.shared. This reusable instance avoids memory allocation overhead from repeatedly creating new Color objects, optimizing performance for real-time conversions and transformations.