sparcoon 0.7.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +124 -76
  2. package/dist/artifact/FXArtifact.d.ts +120 -0
  3. package/dist/artifact/FXArtifact.js +1 -0
  4. package/dist/coreLayout.d.ts +22 -0
  5. package/dist/coreLayout.js +32 -0
  6. package/dist/effect/FXEffect.d.ts +77 -0
  7. package/dist/effect/FXEffect.js +454 -0
  8. package/dist/effect/FXEffectSampling.Internal.d.ts +24 -0
  9. package/dist/effect/FXEffectSampling.Internal.js +165 -0
  10. package/dist/effect/FXEffectSpec.d.ts +115 -0
  11. package/dist/effect/FXEffectSpec.js +1 -0
  12. package/dist/emitter/FXEmitter.Internal.d.ts +23 -58
  13. package/dist/emitter/FXEmitter.Internal.js +13 -29
  14. package/dist/emitter/FXEmitter.d.ts +46 -48
  15. package/dist/emitter/FXEmitter.js +355 -186
  16. package/dist/emitter/FXFromArtifactsOptions.d.ts +13 -0
  17. package/dist/emitter/FXFromArtifactsOptions.js +1 -0
  18. package/dist/emitter/FXObjectMotion.Internal.d.ts +33 -0
  19. package/dist/emitter/FXObjectMotion.Internal.js +87 -0
  20. package/dist/emitter/FXSimulationHolder.d.ts +1 -0
  21. package/dist/emitter/FXSimulationHolder.js +43 -0
  22. package/dist/index.d.ts +10 -39
  23. package/dist/index.js +13 -36
  24. package/dist/instancedParticle/FXInstancedParticle.d.ts +1 -22
  25. package/dist/instancedParticle/FXInstancedParticle.js +145 -85
  26. package/dist/instancedParticle/glTypeInfo.d.ts +5 -0
  27. package/dist/instancedParticle/glTypeInfo.js +3 -0
  28. package/dist/instancedParticle/primitiveGeometry.d.ts +1 -0
  29. package/dist/instancedParticle/primitiveGeometry.js +30 -0
  30. package/dist/miscellaneous/asserts.d.ts +1 -18
  31. package/dist/miscellaneous/asserts.js +21 -28
  32. package/dist/miscellaneous/fxMath.d.ts +26 -0
  33. package/dist/miscellaneous/fxMath.js +261 -0
  34. package/dist/miscellaneous/math.d.ts +2 -7
  35. package/dist/miscellaneous/math.js +8 -9
  36. package/dist/miscellaneous/texture/fxDataTexture.d.ts +26 -0
  37. package/dist/miscellaneous/texture/fxDataTexture.js +20 -0
  38. package/dist/render/FXArtifactMaterial.Internal.d.ts +16 -0
  39. package/dist/render/FXArtifactMaterial.Internal.js +944 -0
  40. package/dist/render/FXArtifactMaterial.d.ts +1 -0
  41. package/dist/render/FXArtifactMaterial.js +79 -0
  42. package/dist/render/FXMaterialOptions.d.ts +27 -0
  43. package/dist/render/FXMaterialOptions.js +5 -0
  44. package/dist/render/FXMeshMaterial.d.ts +40 -0
  45. package/dist/render/FXMeshMaterial.js +77 -0
  46. package/dist/world/FXWorld.d.ts +42 -0
  47. package/dist/world/FXWorld.js +103 -0
  48. package/package.json +45 -29
  49. package/dist/_virtual/2d.js +0 -3
  50. package/dist/_virtual/3d.js +0 -3
  51. package/dist/_virtual/4d.js +0 -3
  52. package/dist/_virtual/mod.js +0 -5
  53. package/dist/_virtual/mod2.js +0 -3
  54. package/dist/emitter/behavior/FXBehavior.d.ts +0 -24
  55. package/dist/emitter/behavior/FXBehavior.js +0 -10
  56. package/dist/emitter/behavior/FXBehaviorDirectionalForce.d.ts +0 -23
  57. package/dist/emitter/behavior/FXBehaviorDirectionalForce.js +0 -72
  58. package/dist/emitter/behavior/FXBehaviorPointForce.d.ts +0 -36
  59. package/dist/emitter/behavior/FXBehaviorPointForce.js +0 -94
  60. package/dist/emitter/behavior/FXBehaviorScaleOverLife.d.ts +0 -24
  61. package/dist/emitter/behavior/FXBehaviorScaleOverLife.js +0 -55
  62. package/dist/emitter/behavior/FXBehaviorTorqueDamping.d.ts +0 -20
  63. package/dist/emitter/behavior/FXBehaviorTorqueDamping.js +0 -48
  64. package/dist/emitter/behavior/FXBehaviorTorqueNoise.d.ts +0 -25
  65. package/dist/emitter/behavior/FXBehaviorTorqueNoise.js +0 -67
  66. package/dist/emitter/behavior/FXBehaviorTorqueOverLife.d.ts +0 -19
  67. package/dist/emitter/behavior/FXBehaviorTorqueOverLife.js +0 -41
  68. package/dist/emitter/behavior/FXBehaviorVelocityDamping.d.ts +0 -20
  69. package/dist/emitter/behavior/FXBehaviorVelocityDamping.js +0 -50
  70. package/dist/emitter/behavior/FXBehaviorVelocityNoise.d.ts +0 -25
  71. package/dist/emitter/behavior/FXBehaviorVelocityNoise.js +0 -76
  72. package/dist/emitter/behavior/FXBehaviorVelocityOverLife.d.ts +0 -22
  73. package/dist/emitter/behavior/FXBehaviorVelocityOverLife.js +0 -55
  74. package/dist/emitter/spawn/FXSpawn.d.ts +0 -11
  75. package/dist/emitter/spawn/FXSpawn.js +0 -10
  76. package/dist/emitter/spawn/FXSpawnBox.d.ts +0 -18
  77. package/dist/emitter/spawn/FXSpawnBox.js +0 -50
  78. package/dist/emitter/spawn/FXSpawnLifetime.d.ts +0 -17
  79. package/dist/emitter/spawn/FXSpawnLifetime.js +0 -44
  80. package/dist/emitter/spawn/FXSpawnOffset.d.ts +0 -21
  81. package/dist/emitter/spawn/FXSpawnOffset.js +0 -49
  82. package/dist/emitter/spawn/FXSpawnPoint.d.ts +0 -18
  83. package/dist/emitter/spawn/FXSpawnPoint.js +0 -46
  84. package/dist/emitter/spawn/FXSpawnRotation.d.ts +0 -17
  85. package/dist/emitter/spawn/FXSpawnRotation.js +0 -42
  86. package/dist/emitter/spawn/FXSpawnScale.d.ts +0 -22
  87. package/dist/emitter/spawn/FXSpawnScale.js +0 -56
  88. package/dist/emitter/spawn/FXSpawnSphere.d.ts +0 -36
  89. package/dist/emitter/spawn/FXSpawnSphere.js +0 -87
  90. package/dist/emitter/spawn/FXSpawnTorque.d.ts +0 -17
  91. package/dist/emitter/spawn/FXSpawnTorque.js +0 -42
  92. package/dist/emitter/spawn/FXSpawnVelocity.d.ts +0 -29
  93. package/dist/emitter/spawn/FXSpawnVelocity.js +0 -91
  94. package/dist/instancedParticle/FXInstancedParticle.Internal.d.ts +0 -2
  95. package/dist/instancedParticle/shared.d.ts +0 -19
  96. package/dist/instancedParticle/shared.js +0 -116
  97. package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.d.ts +0 -24
  98. package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.js +0 -275
  99. package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.d.ts +0 -75
  100. package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.js +0 -63
  101. package/dist/materials/FXMaterial/FXBlending.Internal.d.ts +0 -24
  102. package/dist/materials/FXMaterial/FXBlending.Internal.js +0 -64
  103. package/dist/materials/FXMaterial/FXDepthMaterial.Internal.d.ts +0 -4
  104. package/dist/materials/FXMaterial/FXDepthMaterial.Internal.js +0 -144
  105. package/dist/materials/FXMaterial/FXDistanceMaterial.Internal.d.ts +0 -4
  106. package/dist/materials/FXMaterial/FXDistanceMaterial.Internal.js +0 -175
  107. package/dist/materials/FXMaterial/FXMaterial.d.ts +0 -70
  108. package/dist/materials/FXMaterial/FXMaterial.js +0 -51
  109. package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.d.ts +0 -7
  110. package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.js +0 -103
  111. package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.d.ts +0 -7
  112. package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.js +0 -21
  113. package/dist/miscellaneous/color/FXColor.Internal.d.ts +0 -7
  114. package/dist/miscellaneous/color/FXColor.Internal.js +0 -42
  115. package/dist/miscellaneous/color/FXColor.d.ts +0 -234
  116. package/dist/miscellaneous/color/FXColor.js +0 -636
  117. package/dist/miscellaneous/curve/FXCurve1D.Internal.d.ts +0 -20
  118. package/dist/miscellaneous/curve/FXCurve1D.d.ts +0 -17
  119. package/dist/miscellaneous/curve/FXCurve1D.js +0 -94
  120. package/dist/miscellaneous/miscellaneous.d.ts +0 -34
  121. package/dist/miscellaneous/miscellaneous.js +0 -85
  122. package/dist/miscellaneous/texture/FXTextureView.Internal.d.ts +0 -49
  123. package/dist/miscellaneous/texture/FXTextureView.Internal.js +0 -6
  124. package/dist/miscellaneous/texture/FXTextureView.d.ts +0 -72
  125. package/dist/miscellaneous/texture/FXTextureView.js +0 -234
  126. package/dist/miscellaneous/webglCapabilities.d.ts +0 -1
  127. package/dist/miscellaneous/webglCapabilities.js +0 -45
  128. package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
  129. package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
  130. package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
  131. package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
  132. package/dist/nodes/FXNode.d.ts +0 -5
  133. package/dist/nodes/FXNode.js +0 -10
  134. package/dist/nodes/blending/FXNodeBlending.d.ts +0 -6
  135. package/dist/nodes/blending/FXNodeBlending.js +0 -9
  136. package/dist/nodes/blending/FXNodeLightnessBlendingMask.d.ts +0 -19
  137. package/dist/nodes/blending/FXNodeLightnessBlendingMask.js +0 -65
  138. package/dist/nodes/color/FXNodeColor.d.ts +0 -6
  139. package/dist/nodes/color/FXNodeColor.js +0 -9
  140. package/dist/nodes/color/FXNodeColorOverLife.d.ts +0 -22
  141. package/dist/nodes/color/FXNodeColorOverLife.js +0 -64
  142. package/dist/nodes/color/FXNodeSphericalClip.d.ts +0 -21
  143. package/dist/nodes/color/FXNodeSphericalClip.js +0 -54
  144. package/dist/nodes/normal/FXNodeFlatNormal.d.ts +0 -6
  145. package/dist/nodes/normal/FXNodeFlatNormal.js +0 -17
  146. package/dist/nodes/normal/FXNodeNormal.d.ts +0 -6
  147. package/dist/nodes/normal/FXNodeNormal.js +0 -9
  148. package/dist/nodes/normal/FXNodeSphericalNormal.d.ts +0 -6
  149. package/dist/nodes/normal/FXNodeSphericalNormal.js +0 -24
  150. package/dist/nodes/texture/FXNodeAnimatedTexture.d.ts +0 -52
  151. package/dist/nodes/texture/FXNodeAnimatedTexture.js +0 -151
  152. package/dist/nodes/texture/FXNodeStaticTexture.d.ts +0 -20
  153. package/dist/nodes/texture/FXNodeStaticTexture.js +0 -67
  154. package/dist/nodes/texture/FXNodeTexture.d.ts +0 -6
  155. package/dist/nodes/texture/FXNodeTexture.js +0 -9
@@ -1,103 +0,0 @@
1
- import { MeshBasicMaterial, DoubleSide, NormalBlending } from 'three';
2
- import { PARTICLE_DEFINES } from '../../miscellaneous/miscellaneous.js';
3
- import { buildAlbedoAndBlendingCode } from '../FXMaterial/FXBlending.Internal.js';
4
- import { FXBlending } from '../FXMaterial/FXMaterial.js';
5
-
6
- function buildFXUnlitMaterial(varyings, blending, useAlphaHashing, alphaTest, albedoNodes) {
7
- const attributeDeclarations = [];
8
- const varyingDeclarations = [];
9
- const vertexAssignments = [];
10
- for (const name in varyings) {
11
- const { glslTypeName } = varyings[name];
12
- attributeDeclarations.push(`attribute ${glslTypeName} a_${name};`);
13
- varyingDeclarations.push(`varying ${glslTypeName} p_${name};`);
14
- vertexAssignments.push(`p_${name} = a_${name};`);
15
- }
16
- const material = new MeshBasicMaterial({
17
- name: "FXUnlitMaterial",
18
- transparent: !useAlphaHashing,
19
- depthWrite: useAlphaHashing,
20
- depthTest: true,
21
- alphaHash: useAlphaHashing,
22
- blending: NormalBlending,
23
- side: DoubleSide,
24
- forceSinglePass: true,
25
- alphaTest,
26
- premultipliedAlpha: true,
27
- });
28
- material.onBeforeCompile = (shader) => {
29
- const vertexPreamble = [
30
- PARTICLE_DEFINES,
31
- attributeDeclarations.join("\n"),
32
- "varying vec2 p_uv;",
33
- varyingDeclarations.join("\n"),
34
- ].join("\n");
35
- shader.vertexShader =
36
- vertexPreamble +
37
- "\n" +
38
- shader.vertexShader
39
- .replace("#include <begin_vertex>", [
40
- "p_uv = uv;",
41
- vertexAssignments.join("\n"),
42
- "vec3 transformed = position;",
43
- "#ifdef USE_ALPHAHASH",
44
- " vPosition = vec3(PARTICLE_POSITION_X, PARTICLE_POSITION_Y, PARTICLE_POSITION_Z) + vec3(position.xy, 0.0);",
45
- "#endif",
46
- ].join("\n"))
47
- .replace("#include <project_vertex>", `
48
- // Scale and rotate the billboard offset in camera space
49
- vec2 billboardOffset = position.xy;
50
- billboardOffset.x *= PARTICLE_SCALE_X;
51
- billboardOffset.y *= PARTICLE_SCALE_Y;
52
-
53
- float cosRotation = cos(PARTICLE_ROTATION);
54
- float sinRotation = sin(PARTICLE_ROTATION);
55
- billboardOffset = vec2(
56
- billboardOffset.x * cosRotation - billboardOffset.y * sinRotation,
57
- billboardOffset.x * sinRotation + billboardOffset.y * cosRotation
58
- );
59
-
60
- // Move particle center to view space, then apply the billboard offset
61
- vec3 particleCenter = vec3(PARTICLE_POSITION_X, PARTICLE_POSITION_Y, PARTICLE_POSITION_Z);
62
- vec4 mvPosition = modelViewMatrix * vec4(particleCenter, 1.0);
63
- mvPosition.xy += billboardOffset;
64
- gl_Position = projectionMatrix * mvPosition;
65
- `);
66
- const seenCacheKeys = new Set();
67
- const uniqueHelpers = (nodes) => nodes
68
- .filter((node) => {
69
- if (seenCacheKeys.has(node.cacheKey)) {
70
- return false;
71
- }
72
- seenCacheKeys.add(node.cacheKey);
73
- return true;
74
- })
75
- .map((node) => node.helperFunctions)
76
- .join("\n");
77
- const fragmentPreamble = [
78
- PARTICLE_DEFINES,
79
- "varying vec2 p_uv;",
80
- varyingDeclarations.join("\n"),
81
- albedoNodes.flatMap((node) => node.uniformDeclarations).join("\n"),
82
- uniqueHelpers(albedoNodes),
83
- ].join("\n");
84
- for (const node of albedoNodes) {
85
- Object.assign(shader.uniforms, node.uniforms);
86
- }
87
- const albedoCode = buildAlbedoAndBlendingCode(albedoNodes, blending, useAlphaHashing);
88
- let fragmentShader = shader.fragmentShader;
89
- if (albedoCode.mapFragment !== null) {
90
- fragmentShader = fragmentShader.replace("#include <map_fragment>", albedoCode.mapFragment);
91
- }
92
- fragmentShader = fragmentShader.replace("#include <premultiplied_alpha_fragment>", albedoCode.premultChunk);
93
- shader.fragmentShader = fragmentPreamble + "\n" + fragmentShader;
94
- };
95
- material.customProgramCacheKey = () => [
96
- "fx-unlit",
97
- albedoNodes.map((node) => node.cacheKey).join("-") || "none",
98
- FXBlending[blending],
99
- ].join("_");
100
- return material;
101
- }
102
-
103
- export { buildFXUnlitMaterial };
@@ -1,7 +0,0 @@
1
- import { FXMaterial } from "../FXMaterial/FXMaterial";
2
- /**
3
- * Unlit particle material - renders particles without lighting or shadows
4
- */
5
- export declare class FXUnlitMaterial extends FXMaterial {
6
- prepare(): void;
7
- }
@@ -1,21 +0,0 @@
1
- import { FXMaterial } from '../FXMaterial/FXMaterial.js';
2
- import { buildFXUnlitMaterial } from './FXUnlitMaterial.Internal.js';
3
-
4
- /**
5
- * Unlit particle material - renders particles without lighting or shadows
6
- */
7
- class FXUnlitMaterial extends FXMaterial {
8
- /** @internal */
9
- buildThreeMaterial(varyings) {
10
- return buildFXUnlitMaterial(varyings, this.blending, this.useAlphaHashing, this.alphaTest, this.albedoNodes);
11
- }
12
- prepare() {
13
- let i = 0;
14
- for (const node of this.albedoNodes) {
15
- node.prepare?.(i);
16
- i += 1;
17
- }
18
- }
19
- }
20
-
21
- export { FXUnlitMaterial };
@@ -1,7 +0,0 @@
1
- import type { Color } from "three";
2
- import type { FXColor } from "./FXColor";
3
- /** Color configuration as Three.js Color, hex number, hex string, or FXColor */
4
- export type FXColorConfig = Color | number | string | FXColor;
5
- /** Predefined color names */
6
- export type FXColorName = "black" | "white" | "red" | "green" | "blue" | "yellow" | "cyan" | "magenta" | "gray" | "grey" | "silver" | "maroon" | "olive" | "lime" | "aqua" | "teal" | "navy" | "fuchsia" | "purple" | "orange" | "pink" | "brown" | "gold" | "violet" | "indigo" | "coral" | "salmon" | "khaki" | "plum" | "orchid" | "tan" | "beige" | "mint" | "lavender" | "crimson" | "azure" | "ivory" | "snow";
7
- export declare const COLORS: Record<string, number | undefined>;
@@ -1,42 +0,0 @@
1
- const COLORS = {
2
- black: 0x000000,
3
- white: 0xffffff,
4
- red: 0xff0000,
5
- green: 0x008000,
6
- blue: 0x0000ff,
7
- yellow: 0xffff00,
8
- cyan: 0x00ffff,
9
- magenta: 0xff00ff,
10
- gray: 0x808080,
11
- grey: 0x808080,
12
- silver: 0xc0c0c0,
13
- maroon: 0x800000,
14
- olive: 0x808000,
15
- lime: 0x00ff00,
16
- aqua: 0x00ffff,
17
- teal: 0x008080,
18
- navy: 0x000080,
19
- fuchsia: 0xff00ff,
20
- purple: 0x800080,
21
- orange: 0xffa500,
22
- pink: 0xffc0cb,
23
- brown: 0xa52a2a,
24
- gold: 0xffd700,
25
- violet: 0xee82ee,
26
- indigo: 0x4b0082,
27
- coral: 0xff7f50,
28
- salmon: 0xfa8072,
29
- khaki: 0xf0e68c,
30
- plum: 0xdda0dd,
31
- orchid: 0xda70d6,
32
- tan: 0xd2b48c,
33
- beige: 0xf5f5dc,
34
- mint: 0x98fb98,
35
- lavender: 0xe6e6fa,
36
- crimson: 0xdc143c,
37
- azure: 0xf0ffff,
38
- ivory: 0xfffff0,
39
- snow: 0xfffafa,
40
- };
41
-
42
- export { COLORS };
@@ -1,234 +0,0 @@
1
- import { Color, Vector4 } from "three";
2
- import type { FXColorConfig, FXColorName } from "./FXColor.Internal";
3
- /** RGBA color with RGB, HSL, hex, and named color support */
4
- export declare class FXColor {
5
- private rInternal;
6
- private gInternal;
7
- private bInternal;
8
- private aInternal;
9
- private hInternal;
10
- private sInternal;
11
- private lInternal;
12
- private dirtyInternal;
13
- private rgbDirty;
14
- private hslDirty;
15
- constructor();
16
- /**
17
- * @param r - Red (0-1)
18
- * @param g - Green (0-1)
19
- * @param b - Blue (0-1)
20
- * @param a - Alpha (0-1)
21
- */
22
- constructor(r: number, g: number, b: number, a?: number);
23
- /**
24
- * @param colorName - Named color
25
- * @param a - Alpha (0-1)
26
- */
27
- constructor(colorName: FXColorName, a?: number);
28
- /**
29
- * @param threeColor - Three.js Color object
30
- * @param a - Alpha (0-1)
31
- */
32
- constructor(threeColor: Color, a?: number);
33
- /**
34
- * @param hexRGB - Hex RGB value (e.g., 0xff0000)
35
- * @param a - Alpha (0-1)
36
- */
37
- constructor(hexRGB: number, a?: number);
38
- /**
39
- * @param hexString - Hex string (e.g., "#ffffff" or "#ffffffff")
40
- */
41
- constructor(hexString?: string);
42
- /**
43
- * @param uiColor - FXColor object to copy from
44
- */
45
- constructor(uiColor?: FXColor);
46
- /**
47
- * @param uiColorConfig - FXColorConfig object
48
- */
49
- constructor(uiColorConfig?: FXColorConfig);
50
- /** Black (0x000000) */
51
- static get black(): FXColor;
52
- /** White (0xffffff) */
53
- static get white(): FXColor;
54
- /** Red (0xff0000) */
55
- static get red(): FXColor;
56
- /** Green (0x008000) */
57
- static get green(): FXColor;
58
- /** Blue (0x0000ff) */
59
- static get blue(): FXColor;
60
- /** Yellow (0xffff00) */
61
- static get yellow(): FXColor;
62
- /** Cyan (0x00ffff) */
63
- static get cyan(): FXColor;
64
- /** Magenta (0xff00ff) */
65
- static get magenta(): FXColor;
66
- /** Gray (0x808080) */
67
- static get gray(): FXColor;
68
- /** Grey (0x808080) */
69
- static get grey(): FXColor;
70
- /** Silver (0xc0c0c0) */
71
- static get silver(): FXColor;
72
- /** Maroon (0x800000) */
73
- static get maroon(): FXColor;
74
- /** Olive (0x808000) */
75
- static get olive(): FXColor;
76
- /** Lime (0x00ff00) */
77
- static get lime(): FXColor;
78
- /** Aqua (0x00ffff) */
79
- static get aqua(): FXColor;
80
- /** Teal (0x008080) */
81
- static get teal(): FXColor;
82
- /** Navy (0x000080) */
83
- static get navy(): FXColor;
84
- /** Fuchsia (0xff00ff) */
85
- static get fuchsia(): FXColor;
86
- /** Purple (0x800080) */
87
- static get purple(): FXColor;
88
- /** Orange (0xffa500) */
89
- static get orange(): FXColor;
90
- /** Pink (0xffc0cb) */
91
- static get pink(): FXColor;
92
- /** Brown (0xa52a2a) */
93
- static get brown(): FXColor;
94
- /** Gold (0xffd700) */
95
- static get gold(): FXColor;
96
- /** Violet (0xee82ee) */
97
- static get violet(): FXColor;
98
- /** Indigo (0x4b0082) */
99
- static get indigo(): FXColor;
100
- /** Coral (0xff7f50) */
101
- static get coral(): FXColor;
102
- /** Salmon (0xfa8072) */
103
- static get salmon(): FXColor;
104
- /** Khaki (0xf0e68c) */
105
- static get khaki(): FXColor;
106
- /** Plum (0xdda0dd) */
107
- static get plum(): FXColor;
108
- /** Orchid (0xda70d6) */
109
- static get orchid(): FXColor;
110
- /** Tan (0xd2b48c) */
111
- static get tan(): FXColor;
112
- /** Beige (0xf5f5dc) */
113
- static get beige(): FXColor;
114
- /** Mint (0x98fb98) */
115
- static get mint(): FXColor;
116
- /** Lavender (0xe6e6fa) */
117
- static get lavender(): FXColor;
118
- /** Crimson (0xdc143c) */
119
- static get crimson(): FXColor;
120
- /** Azure (0xf0ffff) */
121
- static get azure(): FXColor;
122
- /** Ivory (0xfffff0) */
123
- static get ivory(): FXColor;
124
- /** Snow (0xfffafa) */
125
- static get snow(): FXColor;
126
- /** Red component (0 to 1) */
127
- get r(): number;
128
- /** Green component (0 to 1) */
129
- get g(): number;
130
- /** Blue component (0 to 1) */
131
- get b(): number;
132
- /** Alpha component (0 to 1) */
133
- get a(): number;
134
- /** Hue component (0 to 360) */
135
- get hue(): number;
136
- /** Saturation component (0 to 1) */
137
- get saturation(): number;
138
- /** Lightness component (0 to 1) */
139
- get lightness(): number;
140
- /** Red component (0 to 1) */
141
- set r(value: number);
142
- /** Green component (0 to 1) */
143
- set g(value: number);
144
- /** Blue component (0 to 1) */
145
- set b(value: number);
146
- /** Alpha component (0 to 1) */
147
- set a(value: number);
148
- /** Hue component (0 to 360) */
149
- set hue(value: number);
150
- /** Saturation component (0 to 1) */
151
- set saturation(value: number);
152
- /** Lightness component (0 to 1) */
153
- set lightness(value: number);
154
- /** Sets to white (default) */
155
- set(): this;
156
- /**
157
- * @param r - Red (0-1)
158
- * @param g - Green (0-1)
159
- * @param b - Blue (0-1)
160
- * @param a - Alpha (0-1)
161
- */
162
- set(r: number, g: number, b: number, a?: number): this;
163
- /**
164
- * @param colorName - Named color
165
- * @param a - Alpha (0-1)
166
- */
167
- set(colorName: FXColorName, a?: number): this;
168
- /**
169
- * @param threeColor - Three.js Color object
170
- * @param a - Alpha (0-1)
171
- */
172
- set(threeColor: Color, a?: number): this;
173
- /**
174
- * @param hexRGB - Hex RGB value (e.g., 0xff0000)
175
- * @param a - Alpha (0-1)
176
- */
177
- set(hexRGB: number, a?: number): this;
178
- /**
179
- * @param hexString - Hex string (e.g., "#ffffff" or "#ffffffff")
180
- */
181
- set(hexString: string): this;
182
- /**
183
- * @param uiColor - FXColor object to copy from
184
- */
185
- set(uiColor: FXColor): this;
186
- /**
187
- * @param uiColorConfig - FXColorConfig object
188
- */
189
- set(uiColorConfig?: FXColorConfig): this;
190
- /** Sets RGBA components directly */
191
- setRGBA(r: number, g: number, b: number, a?: number): this;
192
- /** Returns RGBA as 32-bit hex (RRGGBBAA) */
193
- getHexRGBA(): number;
194
- /** Returns RGB as 24-bit hex (RRGGBB) */
195
- getHexRGB(): number;
196
- /** Returns RGB as hex string ("#ffffff") */
197
- getHexStringRGB(): string;
198
- /** Returns RGBA as hex string ("#ffffffff") */
199
- getHexStringRGBA(): string;
200
- /** Sets from 32-bit hex RGBA (RRGGBBAA) */
201
- setHexRGBA(hex: number): this;
202
- /** Sets from 24-bit hex RGB (RRGGBB) */
203
- setHexRGB(hex: number, a?: number): this;
204
- /**
205
- * Sets from hex string.
206
- *
207
- * @param hexString - Format: "#ffffff" or "#ffffffff"
208
- * @throws If format invalid
209
- */
210
- setHexString(hexString: string): this;
211
- /** Sets from HSL values */
212
- setHSL(h: number, s: number, l: number, a?: number): this;
213
- /**
214
- * Sets from predefined name.
215
- *
216
- * @throws If color name unknown
217
- */
218
- setColorName(colorName: FXColorName, a?: number): this;
219
- /** Sets from linear (GLSL) color space */
220
- setGLSLColor(r: number, g: number, b: number, a?: number): this;
221
- /** Sets from Three.js Color */
222
- setThreeColor(threeColor: Color, a?: number): this;
223
- /** Returns CSS color string ("rgba(255, 0, 0, 1)") */
224
- toCSSColor(): string;
225
- /** Converts to linear (GLSL) color space */
226
- toGLSLColor(result?: Vector4): Vector4;
227
- /** Converts to Three.js Color (without alpha) */
228
- toThreeColor(result?: Color): Color;
229
- /** Copies from another color */
230
- copy(color: FXColor | Color): this;
231
- /** Returns copy of this color */
232
- clone(): FXColor;
233
- private ensureHSLUpdatedFromRGB;
234
- }