ColorTexture constructor

ColorTexture(
  1. Color color, {
  2. int width = 1,
  3. int height = 1,
})

A texture that holds a single color. By default it creates a 1x1 texture.

Implementation

ColorTexture(Color color, {int width = 1, int height = 1})
    : super(
        Uint32List.fromList(
          // ignore: deprecated_member_use
          List.filled(width * height, color.value),
        ).buffer.asByteData(),
        width: width,
        height: height,
        format: PixelFormat.bgra8888,
      );