struct Blend2D::Styling::RGBA32

Defined in:

blend2d/styling/color.cr

Constant Summary

BLACK = RGBA32.new(255, 255, 255, 255)
BLUE = RGBA32.new(0, 0, 255, 255)
GREEN = RGBA32.new(0, 255, 0, 255)
RED = RGBA32.new(255, 0, 0, 255)
WHITE = RGBA32.new(255, 255, 255, 255)

Constructors

Instance Method Summary

Constructor Detail

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

Initialize the color with four 8-bit unsigned integers representing red, green, blue, and alpha.


[View source]
def self.new(packed : UInt32) #

Initialize the color with a 32-bit unsigned integer representing red, green, blue, and alpha.


[View source]

Instance Method Detail

def a : UInt8 #

[View source]
def b : UInt8 #

[View source]
def g : UInt8 #

[View source]
def opaque #

Initialize the color with full alpha.


[View source]
def r : UInt8 #

[View source]
def raw : UInt32 #

Pack the integers into a 32-bit unsigned integer.


[View source]
def to_rgba64 : RGBA64 #

Convert the RGBA32 to an RGBA64 by upscaling each integer to 16 bits.


[View source]
def transparent #

Initialize the color with zero alpha.


[View source]
def with_alpha(alpha : UInt8) #

Initialize the color with the same red, green, and blue values, but with the specified alpha value.


[View source]