Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
terasakisatoshi committed Aug 8, 2024
1 parent e5c08cf commit c6eaa67
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions bin/dart_random_logo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ void main(List<String> arguments) {
ys.reduce((value, element) => value < element ? value : element);
final ysMax =
ys.reduce((value, element) => value > element ? value : element);
final normalizedXs =
xs.map((e) => (1 + ((W - 1 - 1)/(xsMax - xsMin)) * (e - xsMin))).toList();
final normalizedYs =
ys.map((e) => (1 + ((H - 1 - 1)/(ysMax - ysMin)) * (e - ysMin))).toList();
final normalizedXs = xs
.map((e) => (1 + ((W - 1 - 1) / (xsMax - xsMin)) * (e - xsMin)))
.toList();
final normalizedYs = ys
.map((e) => (1 + ((H - 1 - 1) / (ysMax - ysMin)) * (e - ysMin)))
.toList();
final image = img.Image(width: W, height: H);

final red = img.ColorRgb8(
Expand All @@ -42,7 +44,11 @@ void main(List<String> arguments) {
final x = normalizedXs[i].toInt();
final y = normalizedYs[i].toInt();
image.setPixelRgb(
x,y, c.r, c.g, c.b,
x,
y,
c.r,
c.g,
c.b,
);
}
final png = img.encodePng(image);
Expand Down

0 comments on commit c6eaa67

Please sign in to comment.