简体   繁体   中英

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?

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

More info can be found in the reference .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM