class Colors::Palette

Defined in:

colors.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def colorize(num) #

return hex color string, from @colormap given a number num


[View source]
def colormap : Array(String) #

[View source]
def colormap=(colormap : Array(String)) #

[View source]
def help #

return String listing all available colormaps


[View source]
def lerp(color1 = 0, color2 = 16777215, size = 256) #

generate a gradient array using linear interpolation


[View source]
def lerp_sequence(*colors, size = 256) #

run #lerp multiple times to generate a full palette


[View source]
def set_gradient(key) #

set the colormap


[View source]
def set_range(min : Int32, max : Int32) #

set the range, for self.colorize


[View source]