Processing::Color
Inherits Struct / Value / Object
Equivalent of java.awt.Color.
Constructors
new(r : UInt8, g : UInt8, b : UInt8, a : UInt8 = 255)
Sourcenew(r : Int | Float, g : Int | Float, b : Int | Float, a : Int | Float)
Sourcenew(r : Int | Float, g : Int | Float, b : Int | Float)
Sourcenew(gray : UInt8, alpha : UInt8 = 255)
Sourceunpack(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
Instance methods
a=(a : UInt8)
Sourcealpha
Sourceb=(b : UInt8)
Sourceblue
Sourceg=(g : UInt8)
Sourcegreen
Sourcer=(r : UInt8)
Sourcered
Sourceto_i
Converts the color to an 32bit integer.
- Bits 24-31: alpha
- Bits 16-23: red
- Bits 8-15: green
- Bits 0-7: blue