p5.Color

  1. Each color stores the color mode and level maxes that applied at the time of its construction.
  2. These are used to interpret the input arguments (at construction and later for that instance of color) and to format the output e.g. when saturation() is requested.
  3. Internally we store an array representing the ideal RGBA values in floating point form, normalized from 0 to 1.
  4. From this we calculate the closest screen color (RGBA levels from 0 to 255) and expose this to the renderer.
  5. We also cache normalized, floating point components of the color in various representations as they are calculated.
  6. This is done to prevent repeating a conversion that has already been performed.

Esempi

c=new p5.Color();

Metodi

  • c.toString()
  • c.setRed(255)
  • c.setGreen(255)
  • c.setBlue(255)
  • c.setAlpha(1)

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *