Valid color formats supported by PixiJS. These types extend from colord with additional PixiJS-specific formats.
Common Formats:
// CSS Color Namesnew Color('red');new Color('blue');new Color('green');// Hex Valuesnew Color(0xff0000); // RGB integernew Color('#ff0000'); // 6-digit hexnew Color('#f00'); // 3-digit hexnew Color('#ff0000ff'); // 8-digit hex (with alpha)new Color('#f00f'); // 4-digit hex (with alpha)// RGB/RGBA Objectsnew Color({ r: 255, g: 0, b: 0 });new Color({ r: 255, g: 0, b: 0, a: 0.5 });// RGB/RGBA Stringsnew Color('rgb(255, 0, 0)');new Color('rgba(255, 0, 0, 0.5)');new Color('rgb(100% 0% 0%)');new Color('rgba(100% 0% 0% / 50%)');// Arrays (normalized 0-1)new Color([1, 0, 0]); // RGBnew Color([1, 0, 0, 0.5]); // RGBAnew Color(new Float32Array([1, 0, 0, 0.5]));// Arrays (0-255)new Color(new Uint8Array([255, 0, 0]));new Color(new Uint8ClampedArray([255, 0, 0, 128]));// HSL/HSLAnew Color({ h: 0, s: 100, l: 50 });new Color({ h: 0, s: 100, l: 50, a: 0.5 });new Color('hsl(0, 100%, 50%)');new Color('hsla(0deg 100% 50% / 50%)');// HSV/HSVAnew Color({ h: 0, s: 100, v: 100 });new Color({ h: 0, s: 100, v: 100, a: 0.5 }); Copy
// CSS Color Namesnew Color('red');new Color('blue');new Color('green');// Hex Valuesnew Color(0xff0000); // RGB integernew Color('#ff0000'); // 6-digit hexnew Color('#f00'); // 3-digit hexnew Color('#ff0000ff'); // 8-digit hex (with alpha)new Color('#f00f'); // 4-digit hex (with alpha)// RGB/RGBA Objectsnew Color({ r: 255, g: 0, b: 0 });new Color({ r: 255, g: 0, b: 0, a: 0.5 });// RGB/RGBA Stringsnew Color('rgb(255, 0, 0)');new Color('rgba(255, 0, 0, 0.5)');new Color('rgb(100% 0% 0%)');new Color('rgba(100% 0% 0% / 50%)');// Arrays (normalized 0-1)new Color([1, 0, 0]); // RGBnew Color([1, 0, 0, 0.5]); // RGBAnew Color(new Float32Array([1, 0, 0, 0.5]));// Arrays (0-255)new Color(new Uint8Array([255, 0, 0]));new Color(new Uint8ClampedArray([255, 0, 0, 128]));// HSL/HSLAnew Color({ h: 0, s: 100, l: 50 });new Color({ h: 0, s: 100, l: 50, a: 0.5 });new Color('hsl(0, 100%, 50%)');new Color('hsla(0deg 100% 50% / 50%)');// HSV/HSVAnew Color({ h: 0, s: 100, v: 100 });new Color({ h: 0, s: 100, v: 100, a: 0.5 });
7.2.0
Valid color formats supported by PixiJS. These types extend from colord with additional PixiJS-specific formats.
Common Formats: