package io.github.jjsimas.chart2d;

import java.awt.Color;
import java.util.Objects;

public record PieSlice(String name, double value, Color color) {

  public PieSlice {
    name = Objects.requireNonNullElse(name, "");
    color = Objects.requireNonNull(color, "color");
    if (value < 0.0) {
      throw new IllegalArgumentException("slice value must be >= 0");
    }
  }
}
