# Niagara: map a color curve to the normalized particle's ID

**URL:** <https://forums.unrealengine.com/t/niagara-map-a-color-curve-to-the-normalized-particles-id/143850>\
**Category:** FX\
**Tags:** unreal-engine\
**Created:** [May 17, 2020, 7:25pm UTC](https://forums.unrealengine.com/t/niagara-map-a-color-curve-to-the-normalized-particles-id/143850 "2020-05-17T19:25:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PieBaron](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PieBaron](https://forums.unrealengine.com/u/PieBaron)\
**Post date:** [May 17, 2020, 7:25pm UTC](https://forums.unrealengine.com/t/niagara-map-a-color-curve-to-the-normalized-particles-id/143850/1 "2020-05-17T19:25:55Z")

</div>

Hello, how can I map a color curve to the normalized particle’s ID?  
I’ve made my particles be a source for some ribbon particles, and I’d like the ribbons to derive their color from the ribbonID using color lookup from a color curve.  
Is there any tutorials or documentation that could explain how this could be done?

---

<div class="post-metadata">

**Author:** ![PieBaron](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PieBaron](https://forums.unrealengine.com/u/PieBaron)\
**Post date:** [May 18, 2020, 5:57pm UTC](https://forums.unrealengine.com/t/niagara-map-a-color-curve-to-the-normalized-particles-id/143850/2 "2020-05-18T17:57:52Z")

</div>

thanks to discord user Gleurk#1395 for the in depth response:

**for the random color based on the RibbonID, it’s not to complicated**

**here is how I set up this kinda of stuff:**

**First the color setup:**

\*\*  
[![](https://lh5.googleusercontent.com/gy56v2NFmEmRF6ZEwplHUdWaUGWbtYt45I9JspBbgnqz7l_e6igofVloGXEJTrC446jlbCfImvE1NxBa0KjGowNJkWOfi8AisbYkJelaSNWko7mvLMNLj-3T9A27YC7x9M8TNS-C) ](https://lh5.googleusercontent.com/gy56v2NFmEmRF6ZEwplHUdWaUGWbtYt45I9JspBbgnqz7l_e6igofVloGXEJTrC446jlbCfImvE1NxBa0KjGowNJkWOfi8AisbYkJelaSNWko7mvLMNLj-3T9A27YC7x9M8TNS-C)  
\*\*

**I’m using a Curve For Color that allow me to have a nice way friendly way to handle my colors variation and spreading**

**This curve from Color need and “curveIndex” float. A 0 value will pick the color on the extreme left while a value of 1 will fget a color from the extreme right**

**by default this curve Index is using the “NormalizedAge”, I replace this by a dynamic input “Uniform Range” which byu default give me a random value between 0-1**

\*\*  
[![](https://lh5.googleusercontent.com/nArZGxDJEs8xAoXD5kTFJ3dBLBgPMgvrjBStyR3B63brvy95Q-p5I_ZxjnpXqhQfR7VpOKmNvtNp8EoHV9hwaky3rZpgBxeOzYa1FDXUf-MaecIKRXKIlq3H-ShbZAasPkBP7VbY) ](https://lh5.googleusercontent.com/nArZGxDJEs8xAoXD5kTFJ3dBLBgPMgvrjBStyR3B63brvy95Q-p5I_ZxjnpXqhQfR7VpOKmNvtNp8EoHV9hwaky3rZpgBxeOzYa1FDXUf-MaecIKRXKIlq3H-ShbZAasPkBP7VbY)  
\*\*

\*\*  
[![](https://lh5.googleusercontent.com/cgbcHNkLl0tkJEwbv-N8q120mVVbPtTCOMboxOF9jJi_oiwIJobcVAq5MOeVkMP2M4SCx8JBIlYguE8LtthH5sXs7bl0FNsTBE07Mj62Ndcpwj2qMgPBEFIrhzo-eO4m_S-AukkU) ](https://lh5.googleusercontent.com/cgbcHNkLl0tkJEwbv-N8q120mVVbPtTCOMboxOF9jJi_oiwIJobcVAq5MOeVkMP2M4SCx8JBIlYguE8LtthH5sXs7bl0FNsTBE07Mj62Ndcpwj2qMgPBEFIrhzo-eO4m_S-AukkU)  
\*\*

**from there the random color is per particle and we want it to by by Ribbon**

**so let’s check the 'randomness Mode" and set it to "deterministic"**

\*\*new option appears that we will check:  
[![](https://lh4.googleusercontent.com/WKVUBvhUKEMOMYx0t3Nav7qhZtK7n0q8sMBJHwVaIZdn8oHCMCKtB6EtHjfnEIoM7lQnbxXlzqkm6EgoVi250UmRMIyaeprjjGioORrdIcSm3ZWw2rEZ5ZtSKLYtreegm1mXuHrR) ](https://lh4.googleusercontent.com/WKVUBvhUKEMOMYx0t3Nav7qhZtK7n0q8sMBJHwVaIZdn8oHCMCKtB6EtHjfnEIoM7lQnbxXlzqkm6EgoVi250UmRMIyaeprjjGioORrdIcSm3ZWw2rEZ5ZtSKLYtreegm1mXuHrR)  
\*\*

\*\*  
[![](https://lh3.googleusercontent.com/vuTSCpVWibWOqol3Ad2NjPboC0-qPAJ1FH_g8YdAyaAdbVmQMQ-qVoydAwCgM03m6OTRVMA_OeGa7O19N4H45rkqld9bloV7hxd_SodPwwAftZPCqxkkp3usu5ujlYwFWZ3S7eTz) ](https://lh3.googleusercontent.com/vuTSCpVWibWOqol3Ad2NjPboC0-qPAJ1FH_g8YdAyaAdbVmQMQ-qVoydAwCgM03m6OTRVMA_OeGa7O19N4H45rkqld9bloV7hxd_SodPwwAftZPCqxkkp3usu5ujlYwFWZ3S7eTz)  
\*\*  
**Now we get a rand color based on this "Random seed " value**

**We need to put or RibbonID into this “random Seed”, but the RibbonId is not an “Int” type attribute**

**so we need to convert RibbonId to an “Int” first**

**this is also pretty straightforwar**

**I didn’t find any dynamic input that we doing this so let’s create or own…**

\*\*  
[![](https://lh3.googleusercontent.com/wLWqHSM5oqne_vCKUMm_mQ7gu8lRYmwBVRvMDJPu-OlNbMHE35tNHbgUhBQlFsYUCYXt-ZZp6nPPe-DO3pc1XKG87ERB1Yp5Toq-oJLSwevRFXf98IPBYnfYcbip3bmKA9Vkihb4) ](https://lh3.googleusercontent.com/wLWqHSM5oqne_vCKUMm_mQ7gu8lRYmwBVRvMDJPu-OlNbMHE35tNHbgUhBQlFsYUCYXt-ZZp6nPPe-DO3pc1XKG87ERB1Yp5Toq-oJLSwevRFXf98IPBYnfYcbip3bmKA9Vkihb4)  
\*\*

**we just need a "convert " tso that we can use the “Index” of the RibbonId"**

\*\*  
[![](https://lh4.googleusercontent.com/IyqWu6cnI9K3pSlQ_aymCvS1apvf6pQwAzkWk3061XUu479jUduu2wosh2FJTuocRJ9_FIsMDfMt0_mWRQll2Uief4Us3A30bGlRU9IpaNbqXcN-mimuExInXp01S-jbNloXTbkI) ](https://lh4.googleusercontent.com/IyqWu6cnI9K3pSlQ_aymCvS1apvf6pQwAzkWk3061XUu479jUduu2wosh2FJTuocRJ9_FIsMDfMt0_mWRQll2Uief4Us3A30bGlRU9IpaNbqXcN-mimuExInXp01S-jbNloXTbkI)  
\*\*

**In the Random Seed I’ve set my new custom “dynamic input” which need me to input a “NiagaraID” type and will convert it to an "Int"**

**and Voila:**

\*\*  
[![](https://lh3.googleusercontent.com/RGLXVTH1HJ4bIgiAjA9JxucKJ_whzFWMtXTphVFS0QRfjgk1jzY4aPf28AcbbGQ4fzA-mvqs_3nHZVcracVcXQsnfnKqdmfctzFB_BM95tTsdjmrPEOpAQFCCN0lU25ibefMDu6j) ](https://lh3.googleusercontent.com/RGLXVTH1HJ4bIgiAjA9JxucKJ_whzFWMtXTphVFS0QRfjgk1jzY4aPf28AcbbGQ4fzA-mvqs_3nHZVcracVcXQsnfnKqdmfctzFB_BM95tTsdjmrPEOpAQFCCN0lU25ibefMDu6j)  
\*\*  
**Hope it was that I didn’t put too much detail as it can sometime be confusing…**

**And there’s maybe way simpler way that this …**

**I just like to get this nice color gradient…**
