# How to add color for 3d terrain

**URL:** <https://discourse.processing.org/t/how-to-add-color-for-3d-terrain/28548>\
**Category:** Coding Questions\
**Created:** [March 15, 2021, 5:46pm UTC](https://discourse.processing.org/t/how-to-add-color-for-3d-terrain/28548 "2021-03-15T17:46:47Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [March 15, 2021, 8:12pm UTC](https://discourse.processing.org/t/how-to-add-color-for-3d-terrain/28548/3 "2021-03-15T20:12:03Z")

</div>

Hello,

Take a look at this example:  
_[RGBCube \ Examples \ Processing.org](https://processing.org/examples/rgbcube.html)_

Think about how to apply this to the [terrain code](https://thecodingtrain.com/CodingChallenges/011-perlinnoiseterrain.html).

Consider mapping colors to one of the axes and apply that to a vertex.

Other references for color:

- [Color \ Processing.org](https://processing.org/tutorials/color/)
- [color() \ Language (API) \ Processing 3+](https://processing.org/reference/color_.html)
- [colorMode() \ Language (API) \ Processing 3+](https://processing.org/reference/colorMode_.html)

`:)`

Update:

I followed my initial vision and tried this:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/08b381cd8b608b7c2fe71be00431ed244b392758.jpeg)

HSB colorMode was used.

Have fun!

---

_[View the full topic](https://discourse.processing.org/t/how-to-add-color-for-3d-terrain/28548)._
