[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CSPMGYF0PSXSE0BSASDQ24":3,"skill-same:01M7CSPMGYF0PSXSE0BSASDQ24":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7CSPMGYF0PSXSE0BSASDQ24","pixijs-color",null,"Use this skill when creating, converting, or manipulating colors in PixiJS v8. Covers Color class input formats (hex, CSS names, RGB\u002FHSL objects, arrays, Uint8Array), conversion methods (toHex, toNumber, toArray, toRgba), component access, setAlpha\u002Fmultiply\u002Fpremultiply, Color.shared singleton. Triggers on: Color, ColorSource, hex, rgb, hsl, tint, premultiply, Color.shared, color conversion.","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fpixijs-pixijs-skills\u002Fpixijs-color\u002FSkill.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pixijs-color\ndescription: \"Use this skill when creating, converting, or manipulating colors in PixiJS v8. Covers Color class input formats (hex, CSS names, RGB\u002FHSL objects, arrays, Uint8Array), conversion methods (toHex, toNumber, toArray, toRgba), component access, setAlpha\u002Fmultiply\u002Fpremultiply, Color.shared singleton. Triggers on: Color, ColorSource, hex, rgb, hsl, tint, premultiply, Color.shared, color conversion.\"\nlicense: MIT\n---\n\nThe `Color` class creates and converts colors for tints, fills, strokes, and anywhere PixiJS accepts a `ColorSource`. Most APIs accept raw hex\u002Fstrings directly, so explicit `new Color(...)` is only needed when converting formats or manipulating values.\n\n## Quick Start\n\n```ts\nconst fillColor = new Color(\"#ff6600\");\nconsole.log(fillColor.toHex()); \u002F\u002F '#ff6600'\nconsole.log(fillColor.toNumber()); \u002F\u002F 0xff6600\nconsole.log(fillColor.toArray()); \u002F\u002F [1, 0.4, 0, 1]\n\nconst g = new Graphics().rect(0, 0, 200, 100).fill(fillColor);\napp.stage.addChild(g);\n\nconst sprite = Sprite.from(\"hero.png\");\nsprite.tint = \"dodgerblue\";\napp.stage.addChild(sprite);\n\nconst t = Color.shared.setValue(0xffffff).multiply([1, 0.5, 0.5]).toNumber();\nsprite.tint = t;\n```\n\n**Related skills:** `pixijs-scene-graphics` (fill\u002Fstroke colors), `pixijs-scene-sprite` (tint), `pixijs-blend-modes` (compositing).\n\n## Core Patterns\n\n### Accepted input formats\n\n```ts\nimport { Color } from \"pixi.js\";\n\n\u002F\u002F Hex integer\nnew Color(0xff0000);\n\n\u002F\u002F Hex strings\nnew Color(\"#ff0000\");\nnew Color(\"#f00\");\nnew Color(\"ff0000\");\n\n\u002F\u002F CSS color names\nnew Color(\"red\");\nnew Color(\"dodgerblue\");\n\n\u002F\u002F RGB\u002FRGBA objects (components 0-255)\nnew Color({ r: 255, g: 0, b: 0 });\nnew Color({ r: 255, g: 0, b: 0, a: 0.5 });\n\n\u002F\u002F HSL\u002FHSLA objects\nnew Color({ h: 0, s: 100, l: 50 });\nnew Color({ h: 0, s: 100, l: 50, a: 0.5 });\n\n\u002F\u002F HSV\u002FHSVA objects\nnew Color({ h: 0, s: 100, v: 100 });\n\n\u002F\u002F CSS strings\nnew Color(\"rgb(255, 0, 0)\");\nnew Color(\"rgba(255, 0, 0, 0.5)\");\nnew Color(\"hsl(0, 100%, 50%)\");\n\n\u002F\u002F Normalized 0-1 arrays (Float32Array or plain arrays)\nnew Color([1, 0, 0]); \u002F\u002F RGB\nnew Color([1, 0, 0, 0.5]); \u002F\u002F RGBA\n\n\u002F\u002F Uint8 arrays (components 0-255)\nnew Color(new Uint8Array([255, 0, 0]));\nnew Color(new Uint8ClampedArray([255, 0, 0, 128]));\n\n\u002F\u002F 8-digit hex with alpha\nnew Color(\"#ff0000ff\");\nnew Color(\"#f00f\");\n\n\u002F\u002F Copy from another Color instance\nconst red = new Color(\"red\");\nconst copy = new Color(red);\n```\n\n### Conversion methods\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst color = new Color(\"#ff6600\");\n\ncolor.toHex(); \u002F\u002F '#ff6600'\ncolor.toHexa(); \u002F\u002F '#ff6600ff' (hex with alpha)\ncolor.toNumber(); \u002F\u002F 0xff6600\ncolor.toArray(); \u002F\u002F [1, 0.4, 0, 1] (normalized RGBA)\ncolor.toRgbArray(); \u002F\u002F [1, 0.4, 0] (normalized RGB, no alpha)\ncolor.toRgbaString(); \u002F\u002F 'rgba(255,102,0,1)'\ncolor.toRgba(); \u002F\u002F { r: 1, g: 0.4, b: 0, a: 1 }\ncolor.toRgb(); \u002F\u002F { r: 1, g: 0.4, b: 0 }\ncolor.toUint8RgbArray(); \u002F\u002F [255, 102, 0]\n\n\u002F\u002F setValue() is the chainable way to change a color's value\ncolor.setValue(0xff0000).toHex(); \u002F\u002F '#ff0000'\n```\n\n### Component access\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst color = new Color(\"rgba(255, 128, 0, 0.8)\");\n\ncolor.red; \u002F\u002F 1\ncolor.green; \u002F\u002F ~0.502\ncolor.blue; \u002F\u002F 0\ncolor.alpha; \u002F\u002F 0.8\n```\n\nAll component getters return normalized 0-1 values.\n\n### Manipulation\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst color = new Color(\"red\");\n\n\u002F\u002F Set alpha (chainable)\ncolor.setAlpha(0.5);\n\n\u002F\u002F Multiply with another color (destructive, modifies in place)\ncolor.multiply(0x808080);\n\n\u002F\u002F Premultiply alpha (destructive, RGB channels multiplied by alpha)\ncolor.premultiply(0.8);\n\n\u002F\u002F Premultiply alpha only (RGB unchanged)\ncolor.premultiply(0.8, false);\n\n\u002F\u002F Chain operations\nnew Color(\"white\").setAlpha(0.5).multiply([0.8, 0.2, 0.2]);\n```\n\n`multiply()` and `premultiply()` are destructive; they modify the color and set `value` to null (original format is lost).\n\n### Non-destructive premultiplied output\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst color = new Color(\"red\").setAlpha(0.5);\n\nconst packed = color.toPremultiplied(color.alpha); \u002F\u002F 0x7F7F0000\nconst alphaOnly = color.toPremultiplied(color.alpha, false); \u002F\u002F 0x7FFF0000\n```\n\n`toPremultiplied(alpha, applyToRGB?)` returns a 32-bit `0xAARRGGBB` integer without mutating `this`. Use it in batchers and tint math where the source color must be reused. When `applyToRGB` is `false`, only the alpha byte is packed; the RGB stays at its full value.\n\n### Reusing output buffers\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst rgba = new Float32Array(4);\nconst rgb = new Float32Array(3);\nconst rgb8 = new Uint8Array(3);\n\napp.ticker.add(() => {\n  Color.shared.setValue(sprite.tint).toArray(rgba).toRgbArray(rgb);\n\n  Color.shared.toUint8RgbArray(rgb8);\n});\n```\n\n`toArray(out?)`, `toRgbArray(out?)`, and `toUint8RgbArray(out?)` accept a reusable `number[]`, `Float32Array`, `Uint8Array`, or `Uint8ClampedArray` and write into it. Pass your own buffer in hot paths to avoid allocating per frame; omit the argument and the `Color` instance returns its internal cache array.\n\n### Packing for GPU buffers\n\n| Method                   | Returns                                                      |\n| ------------------------ | ------------------------------------------------------------ |\n| `toBgrNumber()`          | 24-bit `0xBBGGRR` integer with R\u002FB swapped                   |\n| `toLittleEndianNumber()` | Same 24-bit swap, convenient for little-endian vertex writes |\n\nBoth are cheap and useful when emitting colors straight into packed vertex attributes.\n\n### Color.shared for temporary operations\n\n```ts\nimport { Color } from \"pixi.js\";\n\n\u002F\u002F One-off conversion without allocating a new Color\nconst hex = Color.shared.setValue(\"#ff6600\").toNumber();\nconst arr = Color.shared.setValue(0xff0000).toArray();\n```\n\n`Color.shared` is a singleton that avoids allocating a new `Color` on every call. This matters in hot paths like render loops or per-frame tint calculations where repeated `new Color()` creates GC pressure. Do not store references to it; other code may mutate it.\n\n```ts\nimport { Color } from \"pixi.js\";\n\n\u002F\u002F Good: reuse shared instance in a per-frame callback\napp.ticker.add(() => {\n  const t = performance.now() \u002F 1000;\n  sprite.tint = Color.shared\n    .setValue(\"white\")\n    .multiply([Math.sin(t) * 0.5 + 0.5, 0.2, 0.8])\n    .toNumber();\n});\n```\n\n### Validating input\n\n```ts\nimport { Color } from \"pixi.js\";\n\nColor.isColorLike(\"red\"); \u002F\u002F true\nColor.isColorLike(\"#ff0000\"); \u002F\u002F true\nColor.isColorLike(0xff0000); \u002F\u002F true\nColor.isColorLike([1, 0, 0]); \u002F\u002F true\nColor.isColorLike({ r: 1, g: 0, b: 0 }); \u002F\u002F true\nColor.isColorLike({ foo: 1 }); \u002F\u002F false\nColor.isColorLike(null); \u002F\u002F false\n```\n\n`Color.isColorLike()` checks the structural shape (string, number, array, or recognized object). It doesn't validate that a string is a real CSS color name, nor that array values fall in range. Use it as a type guard before passing user input to `new Color()` or `setValue()`.\n\n## Common Mistakes\n\n### [MEDIUM] Expecting toRgba() to return 0-255 values\n\nWrong:\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst { r, g, b } = new Color({ r: 255, g: 128, b: 0 }).toRgba();\n\u002F\u002F r = 1, g = ~0.502, b = 0 (NOT 255, 128, 0)\n```\n\nCorrect:\n\n```ts\nimport { Color } from \"pixi.js\";\n\n\u002F\u002F Use toUint8RgbArray() for 0-255 output\nconst [r, g, b] = new Color({ r: 255, g: 128, b: 0 }).toUint8RgbArray();\n\u002F\u002F r = 255, g = 128, b = 0\n```\n\nRGB object _inputs_ use 0-255 range (`{ r: 255, g: 0, b: 0 }`), but all output methods (`toRgba()`, `toRgb()`, `toArray()`, `toRgbArray()`) normalize to 0-1. Use `toUint8RgbArray()` when you need 0-255 integers for CSS or external APIs.\n\n\n### [MEDIUM] Using 0-255 range in color arrays\n\nWrong:\n\n```ts\nimport { Color } from \"pixi.js\";\n\nnew Color([255, 0, 0]); \u002F\u002F NOT red; values are interpreted as 0-1\n```\n\nCorrect:\n\n```ts\nimport { Color } from \"pixi.js\";\n\nnew Color([1, 0, 0]); \u002F\u002F red via normalized array\nnew Color(0xff0000); \u002F\u002F red via hex\nnew Color(\"red\"); \u002F\u002F red via CSS name\nnew Color(new Uint8Array([255, 0, 0])); \u002F\u002F red via Uint8Array (0-255)\n```\n\nPlain number arrays (`number[]` and `Float32Array`) use normalized 0-1 range. `[255, 0, 0]` clamps to `[1, 0, 0]` because values are clamped, but `[200, 100, 50]` does not produce the expected color. Use `Uint8Array` or `Uint8ClampedArray` for 0-255 input.\n\n\n### [MEDIUM] Using utils.string2hex or utils.hex2string\n\nWrong:\n\n```ts\nimport { utils } from \"pixi.js\";\n\nconst hex = utils.string2hex(\"#ff0000\");\n```\n\nCorrect:\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst hex = new Color(\"#ff0000\").toNumber();\nconst str = new Color(0xff0000).toHex();\n```\n\nThe `utils` namespace was removed in v8. Use the `Color` class for all color conversions.\n\n\n## API Reference\n\n- [Color](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fcolor.Color.html.md)\n- [ColorSource](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fcolor.ColorSource.html.md)\n","The `Color` class creates and converts colors for tints, fills, strokes, and anywhere PixiJS accepts a `ColorSource`. Most APIs accept raw hex\u002Fstrings directly, so explicit `new Color(...)` is only needed when converting formats or manipulating values.\n\n## Quick Start\n\n```ts\nconst fillColor = new Color(\"#ff6600\");\nconsole.log(fillColor.toHex()); \u002F\u002F '#ff6600'\nconsole.log(fillColor.toNumber()); \u002F\u002F 0xff6600\nconsole.log(fillColor.toArray()); \u002F\u002F [1, 0.4, 0, 1]\n\nconst g = new Graphics().rect(0, 0, 200, 100).fill(fillColor);\napp.stage.addChild(g);\n\nconst sprite = Sprite.from(\"hero.png\");\nsprite.tint = \"dodgerblue\";\napp.stage.addChild(sprite);\n\nconst t = Color.shared.setValue(0xffffff).multiply([1, 0.5, 0.5]).toNumber();\nsprite.tint = t;\n```\n\n**Related skills:** `pixijs-scene-graphics` (fill\u002Fstroke colors), `pixijs-scene-sprite` (tint), `pixijs-blend-modes` (compositing).\n\n## Core Patterns\n\n### Accepted input formats\n\n```ts\nimport { Color } from \"pixi.js\";\n\n\u002F\u002F Hex integer\nnew Color(0xff0000);\n\n\u002F\u002F Hex strings\nnew Color(\"#ff0000\");\nnew Color(\"#f00\");\nnew Color(\"ff0000\");\n\n\u002F\u002F CSS color names\nnew Color(\"red\");\nnew Color(\"dodgerblue\");\n\n\u002F\u002F RGB\u002FRGBA objects (components 0-255)\nnew Color({ r: 255, g: 0, b: 0 });\nnew Color({ r: 255, g: 0, b: 0, a: 0.5 });\n\n\u002F\u002F HSL\u002FHSLA objects\nnew Color({ h: 0, s: 100, l: 50 });\nnew Color({ h: 0, s: 100, l: 50, a: 0.5 });\n\n\u002F\u002F HSV\u002FHSVA objects\nnew Color({ h: 0, s: 100, v: 100 });\n\n\u002F\u002F CSS strings\nnew Color(\"rgb(255, 0, 0)\");\nnew Color(\"rgba(255, 0, 0, 0.5)\");\nnew Color(\"hsl(0, 100%, 50%)\");\n\n\u002F\u002F Normalized 0-1 arrays (Float32Array or plain arrays)\nnew Color([1, 0, 0]); \u002F\u002F RGB\nnew Color([1, 0, 0, 0.5]); \u002F\u002F RGBA\n\n\u002F\u002F Uint8 arrays (components 0-255)\nnew Color(new Uint8Array([255, 0, 0]));\nnew Color(new Uint8ClampedArray([255, 0, 0, 128]));\n\n\u002F\u002F 8-digit hex with alpha\nnew Color(\"#ff0000ff\");\nnew Color(\"#f00f\");\n\n\u002F\u002F Copy from another Color instance\nconst red = new Color(\"red\");\nconst copy = new Color(red);\n```\n\n### Conversion methods\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst color = new Color(\"#ff6600\");\n\ncolor.toHex(); \u002F\u002F '#ff6600'\ncolor.toHexa(); \u002F\u002F '#ff6600ff' (hex with alpha)\ncolor.toNumber(); \u002F\u002F 0xff6600\ncolor.toArray(); \u002F\u002F [1, 0.4, 0, 1] (normalized RGBA)\ncolor.toRgbArray(); \u002F\u002F [1, 0.4, 0] (normalized RGB, no alpha)\ncolor.toRgbaString(); \u002F\u002F 'rgba(255,102,0,1)'\ncolor.toRgba(); \u002F\u002F { r: 1, g: 0.4, b: 0, a: 1 }\ncolor.toRgb(); \u002F\u002F { r: 1, g: 0.4, b: 0 }\ncolor.toUint8RgbArray(); \u002F\u002F [255, 102, 0]\n\n\u002F\u002F setValue() is the chainable way to change a color's value\ncolor.setValue(0xff0000).toHex(); \u002F\u002F '#ff0000'\n```\n\n### Component access\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst color = new Color(\"rgba(255, 128, 0, 0.8)\");\n\ncolor.red; \u002F\u002F 1\ncolor.green; \u002F\u002F ~0.502\ncolor.blue; \u002F\u002F 0\ncolor.alpha; \u002F\u002F 0.8\n```\n\nAll component getters return normalized 0-1 values.\n\n### Manipulation\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst color = new Color(\"red\");\n\n\u002F\u002F Set alpha (chainable)\ncolor.setAlpha(0.5);\n\n\u002F\u002F Multiply with another color (destructive, modifies in place)\ncolor.multiply(0x808080);\n\n\u002F\u002F Premultiply alpha (destructive, RGB channels multiplied by alpha)\ncolor.premultiply(0.8);\n\n\u002F\u002F Premultiply alpha only (RGB unchanged)\ncolor.premultiply(0.8, false);\n\n\u002F\u002F Chain operations\nnew Color(\"white\").setAlpha(0.5).multiply([0.8, 0.2, 0.2]);\n```\n\n`multiply()` and `premultiply()` are destructive; they modify the color and set `value` to null (original format is lost).\n\n### Non-destructive premultiplied output\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst color = new Color(\"red\").setAlpha(0.5);\n\nconst packed = color.toPremultiplied(color.alpha); \u002F\u002F 0x7F7F0000\nconst alphaOnly = color.toPremultiplied(color.alpha, false); \u002F\u002F 0x7FFF0000\n```\n\n`toPremultiplied(alpha, applyToRGB?)` returns a 32-bit `0xAARRGGBB` integer without mutating `this`. Use it in batchers and tint math where the source color must be reused. When `applyToRGB` is `false`, only the alpha byte is packed; the RGB stays at its full value.\n\n### Reusing output buffers\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst rgba = new Float32Array(4);\nconst rgb = new Float32Array(3);\nconst rgb8 = new Uint8Array(3);\n\napp.ticker.add(() => {\n  Color.shared.setValue(sprite.tint).toArray(rgba).toRgbArray(rgb);\n\n  Color.shared.toUint8RgbArray(rgb8);\n});\n```\n\n`toArray(out?)`, `toRgbArray(out?)`, and `toUint8RgbArray(out?)` accept a reusable `number[]`, `Float32Array`, `Uint8Array`, or `Uint8ClampedArray` and write into it. Pass your own buffer in hot paths to avoid allocating per frame; omit the argument and the `Color` instance returns its internal cache array.\n\n### Packing for GPU buffers\n\n| Method                   | Returns                                                      |\n| ------------------------ | ------------------------------------------------------------ |\n| `toBgrNumber()`          | 24-bit `0xBBGGRR` integer with R\u002FB swapped                   |\n| `toLittleEndianNumber()` | Same 24-bit swap, convenient for little-endian vertex writes |\n\nBoth are cheap and useful when emitting colors straight into packed vertex attributes.\n\n### Color.shared for temporary operations\n\n```ts\nimport { Color } from \"pixi.js\";\n\n\u002F\u002F One-off conversion without allocating a new Color\nconst hex = Color.shared.setValue(\"#ff6600\").toNumber();\nconst arr = Color.shared.setValue(0xff0000).toArray();\n```\n\n`Color.shared` is a singleton that avoids allocating a new `Color` on every call. This matters in hot paths like render loops or per-frame tint calculations where repeated `new Color()` creates GC pressure. Do not store references to it; other code may mutate it.\n\n```ts\nimport { Color } from \"pixi.js\";\n\n\u002F\u002F Good: reuse shared instance in a per-frame callback\napp.ticker.add(() => {\n  const t = performance.now() \u002F 1000;\n  sprite.tint = Color.shared\n    .setValue(\"white\")\n    .multiply([Math.sin(t) * 0.5 + 0.5, 0.2, 0.8])\n    .toNumber();\n});\n```\n\n### Validating input\n\n```ts\nimport { Color } from \"pixi.js\";\n\nColor.isColorLike(\"red\"); \u002F\u002F true\nColor.isColorLike(\"#ff0000\"); \u002F\u002F true\nColor.isColorLike(0xff0000); \u002F\u002F true\nColor.isColorLike([1, 0, 0]); \u002F\u002F true\nColor.isColorLike({ r: 1, g: 0, b: 0 }); \u002F\u002F true\nColor.isColorLike({ foo: 1 }); \u002F\u002F false\nColor.isColorLike(null); \u002F\u002F false\n```\n\n`Color.isColorLike()` checks the structural shape (string, number, array, or recognized object). It doesn't validate that a string is a real CSS color name, nor that array values fall in range. Use it as a type guard before passing user input to `new Color()` or `setValue()`.\n\n## Common Mistakes\n\n### [MEDIUM] Expecting toRgba() to return 0-255 values\n\nWrong:\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst { r, g, b } = new Color({ r: 255, g: 128, b: 0 }).toRgba();\n\u002F\u002F r = 1, g = ~0.502, b = 0 (NOT 255, 128, 0)\n```\n\nCorrect:\n\n```ts\nimport { Color } from \"pixi.js\";\n\n\u002F\u002F Use toUint8RgbArray() for 0-255 output\nconst [r, g, b] = new Color({ r: 255, g: 128, b: 0 }).toUint8RgbArray();\n\u002F\u002F r = 255, g = 128, b = 0\n```\n\nRGB object _inputs_ use 0-255 range (`{ r: 255, g: 0, b: 0 }`), but all output methods (`toRgba()`, `toRgb()`, `toArray()`, `toRgbArray()`) normalize to 0-1. Use `toUint8RgbArray()` when you need 0-255 integers for CSS or external APIs.\n\n\n### [MEDIUM] Using 0-255 range in color arrays\n\nWrong:\n\n```ts\nimport { Color } from \"pixi.js\";\n\nnew Color([255, 0, 0]); \u002F\u002F NOT red; values are interpreted as 0-1\n```\n\nCorrect:\n\n```ts\nimport { Color } from \"pixi.js\";\n\nnew Color([1, 0, 0]); \u002F\u002F red via normalized array\nnew Color(0xff0000); \u002F\u002F red via hex\nnew Color(\"red\"); \u002F\u002F red via CSS name\nnew Color(new Uint8Array([255, 0, 0])); \u002F\u002F red via Uint8Array (0-255)\n```\n\nPlain number arrays (`number[]` and `Float32Array`) use normalized 0-1 range. `[255, 0, 0]` clamps to `[1, 0, 0]` because values are clamped, but `[200, 100, 50]` does not produce the expected color. Use `Uint8Array` or `Uint8ClampedArray` for 0-255 input.\n\n\n### [MEDIUM] Using utils.string2hex or utils.hex2string\n\nWrong:\n\n```ts\nimport { utils } from \"pixi.js\";\n\nconst hex = utils.string2hex(\"#ff0000\");\n```\n\nCorrect:\n\n```ts\nimport { Color } from \"pixi.js\";\n\nconst hex = new Color(\"#ff0000\").toNumber();\nconst str = new Color(0xff0000).toHex();\n```\n\nThe `utils` namespace was removed in v8. Use the `Color` class for all color conversions.\n\n\n## API Reference\n\n- [Color](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fcolor.Color.html.md)\n- [ColorSource](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fcolor.ColorSource.html.md)\n",{"name":5,"license":15,"description":7},"main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fpixijs-pixijs-skills\u002Fpixijs-color",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill pixijs-color",{"tool":38,"command":39},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill pixijs-color",{"tool":41,"command":42},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill pixijs-color","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fpixijs-pixijs-skills\u002Fpixijs-color\u002FSkill.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"metadata.json","REFERENCE","参考文档",433,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fpixijs-pixijs-skills\u002Fpixijs-color\u002Fmetadata.json",[53,60,65,72,77,84],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":61,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":73,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":85,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]