struct

Processing::Color

Inherits Struct / Value / Object

Equivalent of java.awt.Color.

Constructors

new(r : UInt8, g : UInt8, b : UInt8, a : UInt8 = 255)
Source
new(r : Int | Float, g : Int | Float, b : Int | Float, a : Int | Float)
Source
new(r : Int | Float, g : Int | Float, b : Int | Float)
Source
new(gray : UInt8, alpha : UInt8 = 255)
Source
unpack(int : Int32 | UInt32) : Color

Unpacks the color from a 32bit integer.

  • Bits 24-31: alpha
  • Bits 16-23: red
  • Bits 8-15: green
  • Bits 0-7: blue
Source

Instance methods

a=(a : UInt8)
Source
alpha
Source
b=(b : UInt8)
Source
blue
Source
g=(g : UInt8)
Source
green
Source
r=(r : UInt8)
Source
to_i

Converts the color to an 32bit integer.

  • Bits 24-31: alpha
  • Bits 16-23: red
  • Bits 8-15: green
  • Bits 0-7: blue
Source