struct Godot::Color

Overview

A color represented in RGBA format with 32-bit floating point precision per channel.

Defined in:

libgodot/types/color.cr

Constant Summary

BLACK = Color.new(0.0_f32, 0.0_f32, 0.0_f32, 1.0_f32)
BLUE = Color.new(0.0_f32, 0.0_f32, 1.0_f32, 1.0_f32)
CYAN = Color.new(0.0_f32, 1.0_f32, 1.0_f32, 1.0_f32)
GRAY = Color.new(0.5_f32, 0.5_f32, 0.5_f32, 1.0_f32)
GREEN = Color.new(0.0_f32, 1.0_f32, 0.0_f32, 1.0_f32)
MAGENTA = Color.new(1.0_f32, 0.0_f32, 1.0_f32, 1.0_f32)
ORANGE = Color.new(1.0_f32, 0.65_f32, 0.0_f32, 1.0_f32)
RED = Color.new(1.0_f32, 0.0_f32, 0.0_f32, 1.0_f32)
TRANSPARENT = Color.new(0.0_f32, 0.0_f32, 0.0_f32, 0.0_f32)
WHITE = Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32)
YELLOW = Color.new(1.0_f32, 1.0_f32, 0.0_f32, 1.0_f32)

Constructors

Instance Method Summary

Constructor Detail

def self.from_hsv(h : Number, s : Number, v : Number, a : Number = 1.0) : Color #

def self.from_html(hex : String) : Color #

def self.new(r : Float32 = 1.0_f32, g : Float32 = 1.0_f32, b : Float32 = 1.0_f32, a : Float32 = 1.0_f32) #

def self.new(r : Number, g : Number, b : Number, a : Number = 1.0) #

def self.new(pointer : Pointer(Void)) #

def self.new(rgba32 : UInt32) #

Instance Method Detail

def !=(other : Color) : Bool #

def *(other : Color) : Color #

def *(scalar : Number) : Color #

def +(other : Color) : Color #

def -(other : Color) : Color #

def /(scalar : Number) : Color #

def ==(other : Color) : Bool #

def a : Float32 #

def a=(a : Float32) #

def b : Float32 #

def b=(b : Float32) #

def contrasted : Color #

def darkened(amount : Number) : Color #

def g : Float32 #

def g=(g : Float32) #

def inverted : Color #

def is_equal_approx(other : Color) : Bool #

def lerp(to : Color, weight : Number) : Color #

def lightened(amount : Number) : Color #

def r : Float32 #

def r=(r : Float32) #

def to_argb32 : UInt32 #

def to_html(include_alpha : Bool = true) : String #

def to_rgba32 : UInt32 #

def to_s(io : IO) : Void #
Description copied from struct Struct

Same as #inspect(io).