Hexadecimal annotation for colors, is it faster?

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

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!

1 Like

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

2 Likes

Thanks @GoToLoop

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

1 Like