struct Crame::Color

Overview

A color in RGBA format.

Defined in:

crame/color.cr

Constructors

Instance Method Summary

Constructor Detail

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

Create a color given its component.


def self.new #

Create a color with all its component (except alpha) to 0.


Instance Method Detail

def a : Float64 #

The alpha component.


def a=(value : Float64) #

The alpha component.


def b : Float64 #

The blue component.


def b=(value : Float64) #

The blue component.


def blend(other : Color) : Color #

Returns self blended with other.


def darkened(amount : Float64) : Color #

Returns the dark version of self by a specific amount.


def g : Float64 #

The green component.


def g=(value : Float64) #

The green component.


def inverted : Color #

Returns the inverted version of self.


def lightened(amount : Float64) : Color #

Returns the light version of self by a specific amount.


def r : Float64 #

The red component.


def r=(value : Float64) #

The red component.


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

Same as #inspect(io).