struct Processing::Color
- Processing::Color
- Struct
- Value
- Object
Overview
Equivalent of java.awt.Color
.
Defined in:
processing/color.crConstructors
- .new(r : UInt8, g : UInt8, b : UInt8, a : UInt8 = 255)
- .new(r : Int | Float, g : Int | Float, b : Int | Float, a : Int | Float)
- .new(r : Int | Float, g : Int | Float, b : Int | Float)
- .new(gray : UInt8, alpha : UInt8 = 255)
-
.unpack(int : Int32 | UInt32) : Color
Unpacks the color from a 32bit integer.
Instance Method Summary
- #a : UInt8
- #a=(a : UInt8)
- #alpha : UInt8
- #b : UInt8
- #b=(b : UInt8)
- #blue : UInt8
- #g : UInt8
- #g=(g : UInt8)
- #green : UInt8
- #r : UInt8
- #r=(r : UInt8)
- #red : UInt8
-
#to_i : Int32
Converts the color to an 32bit integer.
Constructor Detail
Unpacks the color from a 32bit integer.
- Bits 24-31: alpha
- Bits 16-23: red
- Bits 8-15: green
- Bits 0-7: blue
Instance Method Detail
def to_i : Int32
#
Converts the color to an 32bit integer.
- Bits 24-31: alpha
- Bits 16-23: red
- Bits 8-15: green
- Bits 0-7: blue