generateYaruColor function

Palette generateYaruColor(
  1. int primary
)

Generates a Material color palette from the specified primary color value.

The returned palette contains the following shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900.

The algorithm may adjust the primary color to make it more suitable for the palette. The final primary color is available through the primary property.

final color = generateYaruColor(0xFFE95420);
print(color.primary);
print(color.shades);
print(color[500]);

Implementation

Palette generateYaruColor(int primary) {
  return generateColor(primary, MaterialColors.values);
}