# Convert and Manipulate Colors in PixiJS v8

Mixed color formats and component ranges can cause incorrect tints and alpha values in PixiJS. This skill provides focused Color API guidance and examples for conversions, manipulation, and buffer reuse.

## Install

```bash
npx skillstore add pixijs/pixijs-color
```

## Metadata

- Status: approved
- Slug: pixijs-pixijs-color
- Skillstore revision: r1
- Version status: missing
- Tree hash: 51352b3668c24e48f3c2400306ae2f1b0c0aeadbb0b069fac835e59b2a1d93d2
- Author: pixijs
- GitHub username: pixijs
- License: MIT
- Repository: https://github.com/pixijs/pixijs-skills/tree/83760c6f53462ca9cecd68055041f5a8c94758ce/skills/pixijs-color
- Ref: e6e249e016d8a82f123001d3ec33f29a48529ee3
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/pixijs-pixijs-color
- Manifest: https://skillstore.pages.dev/api/skills/pixijs-pixijs-color/manifest

## Capabilities

- Explains Color inputs, including hex values, CSS strings, RGB/HSL/HSV objects, normalized arrays, and byte arrays.
- Demonstrates conversions to hex, numeric colors, RGBA strings, normalized components, and byte RGB arrays.
- Describes alpha changes, color multiplication, and mutating versus non-mutating premultiplied output.
- Shows Color.shared usage and output buffer reuse for repeated color calculations.
- Explains structural input checks with Color.isColorLike\(\) and their validation limits.
- Provides migration examples replacing utils.string2hex and utils.hex2string with the Color class.

## Use Cases

- Correct Sprite Tint Conversions: Convert CSS colors and numeric values into consistent sprite tints while handling normalized and byte component ranges.
- Reduce Repeated Color Allocations: Review Color.shared usage and reusable output arrays for frequent tint calculations and packed vertex color values.
- Update Legacy Color Utilities: Replace older string and hexadecimal utility calls with PixiJS v8 Color methods.

## Prompt Templates

### Convert a CSS Color

```
Using PixiJS v8, convert dodgerblue into a numeric sprite tint and a hexadecimal string. Explain the relevant Color methods.
```

### Diagnose Component Ranges

```
Explain why my PixiJS v8 colors differ when I pass RGB objects, plain arrays, and Uint8Array values. Show appropriate formats for each.
```

### Choose an Alpha Operation

```
Compare setAlpha(), premultiply(), and toPremultiplied() in PixiJS v8. Recommend an approach when I must preserve the original color.
```

### Review Render Loop Color Handling

```
Review this PixiJS v8 color conversion loop: [paste loop]. Check shared state, cached array references, component ranges, and reusable buffers.
```

## Limitations

- Targets PixiJS v8 Color APIs, not complete scene construction or renderer setup.
- Provides documentation and examples, not bundled executable tools or automated tests.
- Color.isColorLike\(\) checks structure, not valid CSS color names or component ranges.
- Examples require verification against the installed PixiJS version; the skill does not run or validate them.

## Best Practices

- Match input ranges to their formats: normalized values for plain arrays and byte values for RGB objects or Uint8Array.
- Use Color.shared for immediate operations only, and pass reusable output buffers when repeated conversions would create unnecessary allocations.
- Use non-mutating output methods when preserving source colors, and verify conversion results against your installed PixiJS version.

## Anti Patterns

- Treating normalized outputs from toRgba\(\) or toArray\(\) as byte-range RGB values.
- Keeping Color.shared references as persistent state across unrelated operations.
- Using removed utils.string2hex or utils.hex2string APIs in PixiJS v8.

## Security Audit

- Audited at: 2026-11-04T15:55:52.432\+00:00
- Summary: All 47 static findings are false positives: 44 flag Markdown backticks, two flag documentation links, and one misclassifies color buffer documentation as reconnaissance. No evidence found of command execution, data exfiltration, system reconnaissance, or prompt injection in the reviewed SKILL.md.

## Stats

- Views: 0
- Downloads: 1
- Favorites: 0
- Popularity score: 0
