CorePalette.fromList constructor

  1. @Deprecated('Use [DynamicScheme] for color scheme generation.' 'Use [CorePalettes] for core palettes container class.')
CorePalette.fromList(
  1. List<int> colors
)

Create a CorePalette from a fixed-size list of ARGB color ints representing concatenated tonal palettes.

Inverse of asList.

Implementation

@Deprecated(
  'Use [DynamicScheme] for color scheme generation.'
  'Use [CorePalettes] for core palettes container class.',
)
CorePalette.fromList(List<int> colors)
  : assert(colors.length == size * TonalPalette.commonSize),
    primary = TonalPalette.fromList(
      _getPartition(colors, 0, TonalPalette.commonSize),
    ),
    secondary = TonalPalette.fromList(
      _getPartition(colors, 1, TonalPalette.commonSize),
    ),
    tertiary = TonalPalette.fromList(
      _getPartition(colors, 2, TonalPalette.commonSize),
    ),
    neutral = TonalPalette.fromList(
      _getPartition(colors, 3, TonalPalette.commonSize),
    ),
    neutralVariant = TonalPalette.fromList(
      _getPartition(colors, 4, TonalPalette.commonSize),
    );