opposite method

void opposite()

Rotates the hue of every color in the palette by 180 degrees.

Note: Use the ColorPalette.opposites constructor to generate a new palette that includes the colors in this palette and their respective opposites.

Implementation

void opposite() {
  for (var i = 0; i < length; i++) {
    colors[i] = colors[i].opposite as O;
  }
}