pixijs-color

Convert and manipulate PixiJS v8 Color values across input formats.

16|8|Updated May 20, 2020
One-click install
npx skills add https://github.com/encounterplus/web-client --skill pixijs-color-encounterplus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixijs-color
Source: https://github.com/encounterplus/web-client/tree/main/.agents/skills/pixijs-color
Command: npx skills add https://github.com/encounterplus/web-client --skill pixijs-color-encounterplus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create, convert, and transform colors for PixiJS v8 without getting tripped up by different input formats, normalization rules, or alpha/tint behavior.

Core Features & Use Cases

  • Color creation from many inputs: Build PixiJS Color objects from hex, CSS names, numeric and object forms, and typed arrays (including alpha in 8-digit hex).
  • Reliable conversions and packing: Convert to hex strings, numeric values, normalized arrays, RGBA/RGB objects, Uint8 outputs, and packed integers for fast usage.
  • Tint and alpha manipulation: Apply alpha, multiply/premultiply channels, and reuse Color.shared to avoid per-frame allocations in render loops.

Use case: You have a sprite tinting system where users choose colors in UI form (hex strings, CSS names, or RGB inputs) and the renderer needs packed numeric/tint-ready values efficiently every frame.

Quick Start

Use the pixijs-color skill to convert a UI-provided color string into a PixiJS tint number using Color.shared.

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 or CSS color names to PixiJS v8 tint numbers?

Convert hex strings or CSS names to PixiJS v8 tint numbers by constructing a Color object from the input and extracting the packed integer. This safely bridges varied UI string inputs to deterministic tint-ready numeric values.

How do I update sprite tints in a render loop without causing memory allocations?

Update sprite tints without memory allocations by reusing the Color.shared instance for conversions. This non-allocating approach outputs to reusable buffers, preventing garbage collection spikes during per-frame render loop tint updates.

What is the correct way to handle alpha and premultiplied color values in PixiJS?

Handle alpha and premultiplied color values in PixiJS by applying alpha and multiplying color channels during conversion. This ensures correct normalized versus Uint8 component ranges for accurate rendering and GPU packing workflows.

Does PixiJS v8 support batch conversion of colors for GPU vertex attributes?

PixiJS v8 supports batch conversion of colors for GPU vertex attributes by processing typed array inputs into normalized arrays or packed integers. This efficiently prepares bulk color data for GPU rendering and vertex attribute preparation.

Why are my PixiJS color conversions returning incorrect normalized or Uint8 ranges?

PixiJS color conversions return incorrect ranges when deterministic conversion methods are not applied. You must correctly handle normalized versus Uint8 component ranges to ensure accurate color outputs across different formats.