# Hexadecimal annotation for colors, is it faster?

**URL:** https://discourse.processing.org/t/hexadecimal-annotation-for-colors-is-it-faster/5777
**Category:** Processing
**Created:** [November 20, 2018, 7:51pm UTC](https://discourse.processing.org/t/hexadecimal-annotation-for-colors-is-it-faster/5777 "2018-11-20T19:51:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)
#### Post date: [November 20, 2018, 7:51pm UTC](https://discourse.processing.org/t/hexadecimal-annotation-for-colors-is-it-faster/5777/1 "2018-11-20T19:51:52Z")

</div>

Hi,

The title says it all, I’d like to know if calling colors with hexadecimal annotations is faster than the usual `color(255, 0, 0)` for instance.

Thanks

---

<div class="post-metadata">

### Author: ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)
#### Post date: [November 20, 2018, 7:55pm UTC](https://discourse.processing.org/t/hexadecimal-annotation-for-colors-is-it-faster/5777/2 "2018-11-20T19:55:00Z")

</div>

The best way to answer questions like this is to try it out. Create a sketch that uses a million colors in different notations, and add some logic that records how long it takes. I’d be curious to hear about your results, so make sure you report back!

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [November 20, 2018, 7:57pm UTC](https://discourse.processing.org/t/hexadecimal-annotation-for-colors-is-it-faster/5777/3 "2018-11-20T19:57:50Z")

</div>

A literal value is faster than any function or even an expression. 🚤  
Especially considering that **color()** in particular isn’t very performant! 🐌

---

<div class="post-metadata">

### Author: ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)
#### Post date: [November 21, 2018, 6:39pm UTC](https://discourse.processing.org/t/hexadecimal-annotation-for-colors-is-it-faster/5777/4 "2018-11-21T18:39:47Z")

</div>

Thanks @GoToLoop

I suspected the color() function to be slower but wasn’t certain. Now I am.
