- var colors = 3;
- var repeat = 3;

- var sectors = colors * repeat;
- var fakeSectors = Math.ceil(sectors / 2 - 1);

.container
  - for (var i = 1; i <= sectors; ++i) {
    .sector
      - if (i == sectors) {
        - for (var j = 1;j <= fakeSectors;++j) {
          .fake-sector
        - }
      - }
  - }
View Compiled
$color: #f44 #8af #8f8;
$repeat: 3;
$size: 150px;
$lastColorIndex: length($color);
$sectors: $lastColorIndex * $repeat;
$ccw: true;
$dirVal: if($ccw == true, -1, 1);
$angle: (360deg / $sectors) * $dirVal;
$fakeSectors: ceil($sectors / 2 - 1);

body {
  margin: 0;
}
.container {
  margin: 10px auto;
  overflow: hidden;
  position: relative;
  height: $size;
  width: $size;
}
.container, .sector, .fake-sector {
  border-radius: 50%;
}
.sector, .fake-sector {
  position: absolute;
  transform-origin: 50% 0%;
  @for $i from 1 through $lastColorIndex {
    &:nth-of-type(#{$lastColorIndex}n + #{$i}) {
      background: nth($color, $i);
    }
  }
}
.sector {
  top: 50%;
  left: 50%;
  width: $size;
  height: $size;
  margin-left: -$size / 2;
  overflow: hidden;
  @for $i from 1 through $sectors {
    &:nth-of-type(#{$i}) {
      transform: rotate($angle * ($i - 1));
      z-index: $i;
    }
  }
  
}
.fake-sector {
  top: 0%;
  right: 0%;
  width: 100%;
  height: 100%;
  @for $i from 1 through $fakeSectors {
    &:nth-of-type(#{$i}) {
      transform: rotate($angle * $i);
      z-index: $i;
    }
  }
}
View Compiled
Rerun