resolve static method

Color? resolve(
  1. BuildContext context,
  2. TwStyle style
)

Resolves color from TwStyle and TwConfig into Color

Implementation

static Color? resolve(BuildContext context, TwStyle style) {
  if (style.color == null) return null;

  final config = TwConfig.of(context);
  final color = config.colors[style.color];

  if (color == null) {
    _handleMissingColor(style.color!, config.colors.keys.toList());
  }

  return color;
}