@use "sass:map";
@forward "../object";

$object_view: map.merge(
  $base_object,
  (
    "foreground_color": null,
    "background_color": null
  )
);

@function new_state($color_state_map, $color_state_name, $color_map: ()) {
  @return map.deep-merge($color_state_map, (
    $color_state_name: color_obj.init_color_map($color_map)
  ));
}

@function get_value($color_state_map, $color_state_name, $color_name) {
  @return color_obj.get_color(
    map.get($color_state_map, $color_state_name),
    $color_name
  );
}

@function set_value($color_state_map, $color_state_name, $color_name, $color_value) {
  @return map.merge($color_state_map, (
    $color_state_name: color_obj.set_color(
      map.get($color_state_map, $color_state_name),
      $color_name,
      $color_value
    )
  ));
}
