# How do I divide a Lerp into several (\>2) Lerps

**URL:** <https://forums.unrealengine.com/t/how-do-i-divide-a-lerp-into-several-2-lerps/481237>\
**Category:** Rendering\
**Tags:** lerp, unreal-engine, question\
**Created:** [April 1, 2021, 7:01pm UTC](https://forums.unrealengine.com/t/how-do-i-divide-a-lerp-into-several-2-lerps/481237 "2021-04-01T19:01:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devogelt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@devogelt](https://forums.unrealengine.com/u/devogelt)\
**Post date:** [April 1, 2021, 7:01pm UTC](https://forums.unrealengine.com/t/how-do-i-divide-a-lerp-into-several-2-lerps/481237/1 "2021-04-01T19:01:54Z")

</div>

Hello! Material editor question

I’ve been looking at the 3ColorBlend material function. I want to create something similar, but slightly more complex, and I’m struggling a bit with it.

The 3ColorBlend accepts a value. The value is divided into the 0-to-0.5 portion and a 0.5-to-1.0 portion, both of which are converted into separate 0-to-1 values and used for separate Lerps, which are later combined.

Currently, I have recreated this, but using ranges of 0-to-0.75 and 0.75-to-1.0.

I need to accomplish two things:

1. Add a third range, leaving the ranges something like 0-to-0.35, 0.35-to-0.85, and 0.85-to-1.0.
2. Parameterize the ‘keys’ for these ranges. That is, in a material instance, I need to ability to change where the range endpoint is from the previous range, and to still divide up the original 0-to-1 value evenly.

[https://i.imgur.com/bl3lQfu.png](https://i.imgur.com/bl3lQfu.png)

Original 3ColorBlend Material Function for context:

[https://i.imgur.com/PyhD3td.png](https://i.imgur.com/PyhD3td.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 2, 2021, 12:08am UTC](https://forums.unrealengine.com/t/how-do-i-divide-a-lerp-into-several-2-lerps/481237/2 "2021-04-02T00:08:09Z")

</div>

May not be what you need but at some point I was working on a circular progress bar with multiple colours and dug this out from an abandoned material:

 ![334434-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/7/5d71945d3c4f602fe1d049dbd267e17c553765dd.jpeg)

You can discard the radial bit. It kind of does what you need but not really 😑

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/a/a2a4f36040f1487836be58659252f0a1fb2b6c8e.gif)](https://gyazo.com/0615910bd444f73a58b9678bff4054ca)

Fetch the nodes here:

> **[colour blend posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4](https://blueprintue.com/blueprint/8bu4ygre/)**
>
> No description provided

* * *

Afair it was supposed to blend 3 colours but I honestly can’t recall whether it worked the way I wanted it to. Ignore if this turns out to be useless. Perhaps it can push you in the right direction, though…
