SASS-按项目索引获取地图项目值

vsy*_*ync 5 sass

我希望能够通过该地图项目的索引选择SASS地图项目值。
简化方案:

SCSS

// Colors map (MUST stay this way due to system dependence)
$colors: (
    a: red,
    b: green,
    c: blue
);

@for $i from 1 through 3{
    a:nth-child({$i}){ color:[GET COLOR BY $i FROM $COLORS]; }
}
Run Code Online (Sandbox Code Playgroud)

那可能吗?

vsy*_*ync 10

要点演示

$colors: (
    a: red,
    b: green,
    c: blue
);

@each $color, $name in $colors{
  $i: index($colors, $color $name);
  a:nth-child(#{$i}){ color:$color; }
}
Run Code Online (Sandbox Code Playgroud)