struct Processing::Color

Overview

Equivalent of java.awt.Color.

Defined in:

processing/color.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(r : UInt8, g : UInt8, b : UInt8, a : UInt8 = 255) #

[View source]
def self.new(r : Int | Float, g : Int | Float, b : Int | Float, a : Int | Float) #

[View source]
def self.new(r : Int | Float, g : Int | Float, b : Int | Float) #

[View source]
def self.new(gray : UInt8, alpha : UInt8 = 255) #

[View source]
def self.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

[View source]

Instance Method Detail

def a : UInt8 #

[View source]
def a=(a : UInt8) #

[View source]
def alpha : UInt8 #

[View source]
def b : UInt8 #

[View source]
def b=(b : UInt8) #

[View source]
def blue : UInt8 #

[View source]
def g : UInt8 #

[View source]
def g=(g : UInt8) #

[View source]
def green : UInt8 #

[View source]
def r : UInt8 #

[View source]
def r=(r : UInt8) #

[View source]
def red : UInt8 #

[View source]
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

[View source]