Skip to content

Commit 2f64596

Browse files
change the default background color to white instead of black
1 parent 2065af4 commit 2f64596

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/formats/jpeg_encoder.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class JpegEncoder extends Encoder {
123123
return fp.getBytes();
124124
}
125125

126-
static const _black = const ConstColorRgb8(0, 0, 0);
126+
static const _backgroundColor = const ConstColorRgb8(255, 255, 255);
127127

128128
void _calculateYUV(
129129
Image image,
@@ -157,7 +157,7 @@ class JpegEncoder extends Encoder {
157157
p = p.convert(format: Format.uint8);
158158
}
159159
if (p.length > 3) {
160-
final backgroundColor = image.backgroundColor ?? _black;
160+
final backgroundColor = image.backgroundColor ?? _backgroundColor;
161161
final a = p.aNormalized;
162162
final invA = 1.0 - a;
163163
p..r = (p.r * a + backgroundColor.r * invA).round()

0 commit comments

Comments
 (0)