Pro Q
Pro Q

Reputation: 5016

How to get particular component of color in p5.js

From the p5 docs, it looks like there are methods to set components of color, but none to get them.

Given an object of class p5.Color, how do I get the red component of that color?

Upvotes: 0

Views: 605

Answers (1)

Kevin Workman
Kevin Workman

Reputation: 42176

You can use the red(), blue(), and green() functions.

More info can be found in the reference.

Upvotes: 1

Related Questions