class ColorUtil::SemanticPalette
- ColorUtil::SemanticPalette
- Reference
- Object
Included Modules
- YAML::Serializable
Defined in:
colorutil/semantic_palette.crConstant Summary
-
DEFAULT_SIZE =
2
-
READABLE_CONTRAST =
3.5
Constructors
-
.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.
- .new(driver : ColorUtil::Color, qualia : Array(Array(Float64)), rules : Array(Array(Float64)))
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new
Class Method Summary
-
.construct_rules(tensor : Tensor) : Array(Array(Float64))
Rebuilds a set of rules given a contrast tensor.
Instance Method Summary
-
#bake : BakedPalette
Returns a
BakedPalette
instantiated with this semantic information -
#contrast_tensor : Tensor(Float64)
Returns a square matrix with
PALETTE_SIZE
rows. -
#driver : Color
The driver is the 0th color in a baked keyframe.
-
#driver=(driver : Color)
The driver is the 0th color in a baked keyframe.
-
#qualia : Array(Array(Float64))
[[h, s], [h, s], ..] (Hues and saturations for each foreground color, starting at color 1
-
#qualia=(qualia : Array(Array(Float64)))
[[h, s], [h, s], ..] (Hues and saturations for each foreground color, starting at color 1
-
#rules : Array(Array(Float64))
[[color1, color2, contrast], ...] (Pairs of color indecies and the contrast between them)
-
#rules=(rules : Array(Array(Float64)))
[[color1, color2, contrast], ...] (Pairs of color indecies and the contrast between them)
Constructor Detail
TODO Rename variables to start and stop Create a new keyframe via the interpolation of the previous ans subsequent keyframe.
Class Method Detail
Rebuilds a set of rules given a contrast tensor.
Instance Method Detail
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)
.
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
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
[[h, s], [h, s], ..] (Hues and saturations for each foreground color, starting at color 1
[[h, s], [h, s], ..] (Hues and saturations for each foreground color, starting at color 1
[[color1, color2, contrast], ...] (Pairs of color indecies and the contrast between them)
[[color1, color2, contrast], ...] (Pairs of color indecies and the contrast between them)