19 lines
593 B
Dart
19 lines
593 B
Dart
import 'dart:io';
|
|
import 'package:image/image.dart' as img;
|
|
|
|
void main() {
|
|
final image = img.Image(width: 512, height: 512);
|
|
img.fill(image, color: img.ColorRgb8(17, 17, 17)); // Dark grey
|
|
|
|
// Draw a cyan circle
|
|
img.drawCircle(image, x: 256, y: 256, radius: 200, color: img.ColorRgb8(0, 255, 255));
|
|
// Draw a red needle
|
|
img.drawLine(image, x1: 256, y1: 256, x2: 350, y2: 150, color: img.ColorRgb8(255, 0, 0), thickness: 10);
|
|
|
|
final png = img.encodePng(image);
|
|
File('assets/icon.png')
|
|
..createSync(recursive: true)
|
|
..writeAsBytesSync(png);
|
|
print('Icon generated.');
|
|
}
|