class ColorUtil::SemanticPalette

Included Modules

Defined in:

colorutil/semantic_palette.cr

Constant Summary

DEFAULT_SIZE = 2
READABLE_CONTRAST = 3.5

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(prev : SemanticPalette, subs : SemanticPalette, rise : Float64) #

TODO Rename variables to start and stop Create a new keyframe via the interpolation of the previous ans subsequent keyframe.


[View source]
def self.new(driver : ColorUtil::Color, qualia : Array(Array(Float64)), rules : Array(Array(Float64))) #

[View source]
def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new #

[View source]

Class Method Detail

def self.construct_rules(tensor : Tensor) : Array(Array(Float64)) #

Rebuilds a set of rules given a contrast tensor.


[View source]

Instance Method Detail

def bake : BakedPalette #

Returns a BakedPalette instantiated with this semantic information


[View source]
def contrast_tensor : Tensor(Float64) #

Returns a square matrix with PALETTE_SIZE rows. The value at the index (i, j) is the contrast between color i and color j. If the contrast between the two is zero, there is no contrast rule for the pair (i, j).


[View source]
def driver : Color #

The driver is the 0th color in a baked keyframe. It is the only fully defined color, and BakedPalette uses it as a basis for


[View source]
def driver=(driver : Color) #

The driver is the 0th color in a baked keyframe. It is the only fully defined color, and BakedPalette uses it as a basis for


[View source]
def qualia : Array(Array(Float64)) #

[[h, s], [h, s], ..] (Hues and saturations for each foreground color, starting at color 1


[View source]
def qualia=(qualia : Array(Array(Float64))) #

[[h, s], [h, s], ..] (Hues and saturations for each foreground color, starting at color 1


[View source]
def rules : Array(Array(Float64)) #

[[color1, color2, contrast], ...] (Pairs of color indecies and the contrast between them)


[View source]
def rules=(rules : Array(Array(Float64))) #

[[color1, color2, contrast], ...] (Pairs of color indecies and the contrast between them)


[View source]