ColorSet.of constructor

ColorSet.of(
  1. Color backgroundColor
)

Factory method to create a ColorSet from a given background or surface color.

Implementation

factory ColorSet.of(Color backgroundColor) {
  Color foregroundColor = getOnSurfaceColor(backgroundColor);
  Color mutedForegroundColor = reduceAlpha(foregroundColor);
  return ColorSet(backgroundColor, foregroundColor, mutedForegroundColor);
}