# Different color of particles when creating particle via code and node particle editor

**URL:** <https://forum.babylonjs.com/t/different-color-of-particles-when-creating-particle-via-code-and-node-particle-editor/62429>\
**Category:** Bugs\
**Tags:** particles, particle-system-set\
**Created:** [February 13, 2026, 3:06am UTC](https://forum.babylonjs.com/t/different-color-of-particles-when-creating-particle-via-code-and-node-particle-editor/62429 "2026-02-13T03:06:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TooCalm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/toocalm/32/3301_2.png) [@TooCalm](https://forum.babylonjs.com/u/TooCalm)\
**Post date:** [February 13, 2026, 3:06am UTC](https://forum.babylonjs.com/t/different-color-of-particles-when-creating-particle-via-code-and-node-particle-editor/62429/1 "2026-02-13T03:06:33Z")

</div>

I created particle via code and recreated it in node particle editor. I used the same colors for both. But they are different in result

via code [https://playground.babylonjs.com/#FJYR0B#1](https://playground.babylonjs.com/#FJYR0B#1)

```
    partlcleEffect.color1 = BABYLON.Color4.FromInts(58, 89, 133, 255);

    partlcleEffect.color2 = BABYLON.Color4.FromInts(137, 175, 224, 255);

    partlcleEffect.colorDead = BABYLON.Color4.FromInts(137, 175, 224, 255);

```

via npe [https://playground.babylonjs.com/#FJYR0B#2](https://playground.babylonjs.com/#FJYR0B#2)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/3/33183ddd7bf031b5eafbd2199a33972fc3e7be94.png)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/6/e69ca02b60189bc9e696e396718b406fe7297e40.png)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/2/12b1dbc416ec565a163e121d6c06f6202fa7410f.png)

in npe case there is violet color somehow. is it bug or i’m doing something wrong?

Thanks!

---

<div class="post-metadata">

**Author:** ![AlitarSemiramis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alitarsemiramis/32/49920_2.png) [@AlitarSemiramis](https://forum.babylonjs.com/u/AlitarSemiramis)\
**Post date:** [February 13, 2026, 8:15am UTC](https://forum.babylonjs.com/t/different-color-of-particles-when-creating-particle-via-code-and-node-particle-editor/62429/2 "2026-02-13T08:15:29Z")

</div>

The equivalent NPE system is a little different to what you did as you also need a color update step. You can use the function ConvertToNodeParticleSystemSetAsync to see how your regular system would look in NPE.

In your case, you can see it in this playground:  
[fps drop test for https://forum.babylonjs.com/t/no-possibility-to-create-gpu-particle-system-via-node-particle-editor/62 | Babylon.js Playground](https://playground.babylonjs.com/#FJYR0B#3)

And this is the node graph:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/3/8310495f2e2c5365c57c342745856f5d9b4a8c4c.png)

---

<div class="post-metadata">

**Author:** ![TooCalm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/toocalm/32/3301_2.png) [@TooCalm](https://forum.babylonjs.com/u/TooCalm)\
**Post date:** [February 13, 2026, 11:14am UTC](https://forum.babylonjs.com/t/different-color-of-particles-when-creating-particle-via-code-and-node-particle-editor/62429/3 "2026-02-13T11:14:49Z")

</div>

but color of the converted particle system is still wrong in NPE

particle system

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/9/a93f3939ed631a8d08455dbab2f78dd748bef85b.jpeg)

converted particle system to npe

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/8/28130bf622b732b5d617f72fbb9a700179c88610.jpeg)

there is a violet color which shouldn’t be there

---

<div class="post-metadata">

**Author:** ![AlitarSemiramis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alitarsemiramis/32/49920_2.png) [@AlitarSemiramis](https://forum.babylonjs.com/u/AlitarSemiramis)\
**Post date:** [February 15, 2026, 7:40am UTC](https://forum.babylonjs.com/t/different-color-of-particles-when-creating-particle-via-code-and-node-particle-editor/62429/4 "2026-02-15T07:40:34Z")

</div>

I’ll keep investigating this! Monday is a holiday here, but I will look at this on Tuesday.

---

<div class="post-metadata">

**Author:** ![AlitarSemiramis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alitarsemiramis/32/49920_2.png) [@AlitarSemiramis](https://forum.babylonjs.com/u/AlitarSemiramis)\
**Post date:** [February 18, 2026, 6:39am UTC](https://forum.babylonjs.com/t/different-color-of-particles-when-creating-particle-via-code-and-node-particle-editor/62429/5 "2026-02-18T06:39:32Z")

</div>

So there was a bug on the conversion function, but NPE was generating colors correctly:

[[NPE] Using Lerp instead of Random for initial color by VicenteCartas · Pull Request #17914 · BabylonJS/Babylon.js](https://github.com/BabylonJS/Babylon.js/pull/17914)

The issue for the initial playground and the conversion function was that they were using a random between two colors, which can do things like produce the violet. While thinParticleSystem what it does is to lerp between both colors. This PR updates the conversion function to Lerp instead of Random, and now the colors are fine.
