global

def color_map(color_scheme = COLOR_SCHEME)

Returns:
  • (Hash) - a map for {character_position => color}
def color_map(color_scheme = COLOR_SCHEME)
  @color_map ||=
    match_map
    .transform_values { |matched| color_scheme.fetch(matched) }
    .map { |node, color| color_map_for(node, color) }
    .inject(:merge)
    .tap { |h| h.default = color_scheme.fetch(:not_visitable) }
end