# Colours from a \[0,1\] float?

**URL:** <https://discourse.julialang.org/t/colours-from-a-0-1-float/112866>\
**Category:** Visualization\
**Tags:** colors\
**Created:** [April 12, 2024, 9:28am UTC](https://discourse.julialang.org/t/colours-from-a-0-1-float/112866 "2024-04-12T09:28:50Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 12, 2024, 11:10am UTC](https://discourse.julialang.org/t/colours-from-a-0-1-float/112866/5 "2024-04-12T11:10:00Z")

</div>

> [@sylvaticus](#):
>
> Thanks. Can the “limits” of the colour scheme be specified programmatically?

Yes. See: [Color Range: pick color in range base on values in a vector - #4 by stevengj](https://discourse.julialang.org/t/color-range-pick-color-in-range-base-on-values-in-a-vector/80533/4)

> [@sylvaticus](#):
>
> `weighted_color_mean(x, lcolour, ucolour)`

As explained in the linked post, doing linear interpolation like this produces a color map that is not perceptually uniform (distorts data).

---

_[View the full topic](https://discourse.julialang.org/t/colours-from-a-0-1-float/112866)._
