Skip to content

Commit

Permalink
fix: wind speed not visible in dark mode #259
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Dec 6, 2024
1 parent bf8da61 commit 515b475
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/services/weatherData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export interface CommonData {
color?: string | Color;
textColor?: string | Color;
backgroundColor?: string | Color;
customDrawColor?: string | Color;
paint?: Paint;
iconFontSize?: number;
icon?: string;
Expand Down Expand Up @@ -604,13 +605,17 @@ export class DataService extends Observable {
iconFontSize,
paint: wiPaint,
backgroundColor: item.windGust > 80 ? '#ff0353' : item.windGust > 50 ? '#FFBC03' : undefined,
color: item.windGust > 80 ? (isEInk ? '#000000' : '#ffffff') : item.windGust > 50 ? '#222' : '#FFBC03',
customDrawColor: item.windGust > 80 ? (isEInk ? '#000000' : '#ffffff') : item.windGust > 50 ? '#222' : '#FFBC03',
color: item.windGust > 80 ? (isEInk ? '#000000' : '#ffffff') : item.windGust > 50 ? undefined : '#FFBC03',
icon,
value: data[0],
subvalue: data[1],
customDraw(canvas: Canvas, fontScale: number, textPaint: Paint, data: CommonData, x: number, y: number, withIcon = false) {
textPaint.setTextSize(11 * fontScale);
textPaint.setColor(data.color);
if (data.customDrawColor) {
textPaint.setColor(data.customDrawColor);

}
const staticLayout = new StaticLayout(
withIcon
? createNativeAttributedString(
Expand All @@ -619,7 +624,7 @@ export class DataService extends Observable {
{
fontFamily: data.paint.fontFamily,
fontSize: data.iconFontSize * 0.9,
color: data.color,
color: data.customDrawColor,
text: data.icon,
verticalAlignment: 'center'
},
Expand Down

0 comments on commit 515b475

Please sign in to comment.