////
/// Radio Tool
/// @group radio
////

@use 'sass:math';

@function radio-background-image($checked: true, $size: md, $index: 1) {
  $color1: '$color##{$index}';
  $color2: '$color##{$index + 1}';
  $max: 12;
  @if $size == sm {
    $max: 8;
  }

  @if $checked {
    $in: $max * 0.5;
    @return 'radial-gradient(transparent #{$max - 2}px, #{$color1} #{$max - 1}px, transparent #{$max}px), radial-gradient(#{$color2} #{$in - 1}px, transparent #{$in}px)';
  }
  @else {
    @return 'radial-gradient(transparent #{$max - 2}px, #{$color1} #{$max - 1}px, transparent #{$max}px)';
  }
}

@function radio-rich-background-image($checked: true) {
  @return 'linear-gradient(0deg, $color#1, $color#1), linear-gradient(0deg, $color#1, $color#1), linear-gradient(0deg, $color#1, $color#1), linear-gradient(0deg, $color#1, $color#1), #{radio-background-image($checked, sm, 2)}';
}
