File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 88import java .io .*;
99import java .net .MalformedURLException ;
1010import java .net .URL ;
11+ import java .util .Arrays ;
1112import java .util .Base64 ;
1213
1314/**
@@ -710,17 +711,17 @@ public Color getPixel(int x, int y) {
710711 int xStart = x * xScale ;
711712 int yStart = y * yScale ;
712713
713- for (int xi = xStart ; xi < xStart + xScale ; xi ++) {
714- for (int yi = yStart ; yi < yStart + yScale ; yi ++) {
715- argb [xi * xScale + yi ] = image .getRGB (xi , yi );
714+ for (int xi = 0 ; xi < xScale ; xi ++) {
715+ for (int yi = 0 ; yi < yScale ; yi ++) {
716+ argb [xi * xScale + yi ] = image .getRGB (xi + xStart , yi + yStart );
716717 }
717718 }
718719
719720 return Palette .fromARGB (
720- averageColor (argb , 0 ),
721- averageColor (argb , 1 ),
721+ averageColor (argb , 3 ),
722722 averageColor (argb , 2 ),
723- averageColor (argb , 3 )
723+ averageColor (argb , 1 ),
724+ averageColor (argb , 0 )
724725 );
725726 }
726727 }
You can’t perform that action at this time.
0 commit comments