# Hue with specific colors

**URL:** https://discourse.processing.org/t/hue-with-specific-colors/6297
**Category:** Coding Questions
**Tags:** homework
**Created:** [December 4, 2018, 8:33pm UTC](https://discourse.processing.org/t/hue-with-specific-colors/6297 "2018-12-04T20:33:26Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [December 7, 2018, 12:50am UTC](https://discourse.processing.org/t/hue-with-specific-colors/6297/6 "2018-12-07T00:50:30Z")

</div>

You might also be interested in lerpColor, which can be used to produce different hue gradients by modifying the input colors.

> **[lerpColor() / Reference](https://processing.org/reference/lerpColor_.html)**
>
> Calculates a color between two colors at a specific increment. The amt parameter is the amount to interpolate between the two values where 0.0 is equal to the first point, 0.1 is very ne…

A recent lerpColor sketch:

> [@Setting limit of random colours](https://discourse.processing.org/t/setting-limit-of-random-colours/6051/6):
>
> Another option is to choose a random point on a color spectrum using lerpColor() and passing it two colors and a random value between 0-1. [https://processing.org/reference/lerpColor\_.html](https://processing.org/reference/lerpColor_.html) color from = color(204, 102, 0); color to = color(0, 102, 153); void setup() { frameRate(1); } void draw() { // random background in color range color randc = lerpColor(from, to, random(1)); background (randc); // draw color bar for(int i=0; i\<10; i++){ fill(lerpColor(from, to, i/10.0)); r…

---

_[View the full topic](https://discourse.processing.org/t/hue-with-specific-colors/6297)._
