class Tres::Color

Defined in:

tres/math/color.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Tres::Vector3

apply_axis_angle(axis, angle) apply_axis_angle, apply_euler(euler) apply_euler, apply_matrix3(m) apply_matrix3, apply_matrix4(m) apply_matrix4, apply_projection(m) apply_projection, apply_quaternion(q) apply_quaternion, clone clone, cross(v) cross, cross_vectors(a, b) cross_vectors, distance_to_squared(v) distance_to_squared, dot(v) dot, from_attribute(attribute, index, offset = 0) from_attribute, length_manhattan length_manhattan, project(camera) project, set(x, y, z) set, set_from_matrix_column(index, matrix) set_from_matrix_column, set_from_matrix_position(m) set_from_matrix_position, set_from_matrix_scale(m) set_from_matrix_scale, transform_direction(m) transform_direction, unproject(camera) unproject, x x, x=(value) x=, y y, y=(value) y=, z z, z=(value) z=

Constructor methods inherited from class Tres::Vector3

new(x = 0, y = 0, z = 0) new

Class methods inherited from class Tres::Vector3

dimensions dimensions, elements elements

Instance methods inherited from class Tres::Vector

==(v) ==, [](index) [], []=(index, value) []=, add(v) add, add_scalar(s) add_scalar, add_vectors(a, b) add_vectors, angle_to(v) angle_to, ceil ceil, clamp(min, max) clamp, clamp_scalar(min, max) clamp_scalar, copy(v) copy, distance_to(v) distance_to, divide(v) divide, divide_scalar(s) divide_scalar, each_dimension(&) each_dimension, elements : Array(Float32) elements, elements=(elements : Array(Float32)) elements=, floor floor, from_array(array : Array(Float32), offset = 0) from_array, length length, length_sq length_sq, lerp(v, alpha) lerp, lerp_vectors(v1, v2, alpha) lerp_vectors, max(v) max, min(v) min, multiply(v) multiply, multiply_scalar(s) multiply_scalar, multiply_vectors(a, b) multiply_vectors, negate negate, normalize normalize, project_on_plane(plane_normal) project_on_plane, project_on_vector(vector) project_on_vector, reflect(normal) reflect, round round, round_to_zero round_to_zero, set(elements : Array(Float32)) set, set_length(l) set_length, sub(v) sub, sub_scalar(s) sub_scalar, sub_vectors(a, b) sub_vectors, to_a(array = [0_f32, 0_f32], offset = 0) to_a, to_array(array = [0_f32, 0_f32], offset = 0) to_array, to_s to_s

Constructor methods inherited from class Tres::Vector

new(elements : Array(Float32)) new

Constructor Detail

def self.new(red, green, blue) #

[View source]
def self.new(color : Color) #

[View source]
def self.new(hex : Int) #

[View source]
def self.new(style : String) #

[View source]
def self.new #

[View source]

Class Method Detail

def self.dimensions #

[View source]
def self.elements #

[View source]

Instance Method Detail

def add_colors(a, b) #

[View source]
def b #

[View source]
def b=(v) #

[View source]
def clone #

[View source]
def convert_gamma_to_linear #

[View source]
def convert_linear_to_gamma #

[View source]
def copy_gamma_to_linear(color, gamma_factor = 2.0_f32) #

[View source]
def copy_linear_to_gamma(color, gamma_factor = 2.0_f32) #

[View source]
def g #

[View source]
def g=(v) #

[View source]
def hex #

[View source]
def hex_string #

[View source]
def hsl #

h,s,l ranges are in 0.0 - 1.0


[View source]
def offset_hsl(h, s, l) #

[View source]
def r #

[View source]
def r=(v) #

[View source]
def set(value : Color) #

[View source]
def set(value : Int) #

[View source]
def set(value : String) #

[View source]
def set_hex(hex) #

[View source]
def set_hsl(h, s, l) #

[View source]
def set_rgb(r, g, b) #

[View source]
def set_style(style) #

[View source]
def style #

[View source]