@@ -30,7 +30,9 @@ Item {
3030 property real fontScale: 1.0
3131
3232 property alias headerAlignment: titleLabel.horizontalAlignment
33+ property bool inOverlay: template["overlay"] === true
3334 property bool hasBackground: template && template["card-background"] !== undefined
35+ property color fontColor: getFontColor(background.color)
3436
3537 visible: mascotImage.status === Image.Ready || title || price
3638 height: row.height > 0 ? row.height + row.margins * 2 : 0
@@ -90,7 +92,7 @@ Item {
9092 maximumLineCount: 2
9193 fontSize: "small"
9294 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
93− color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText
95+ color: fontColor
9496 }
9597
9698 Label {
@@ -102,7 +104,7 @@ Item {
102104 visible: titleLabel.text && text
103105 fontSize: "x-small"
104106 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
105− color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText
107+ color: fontColor
106108 }
107109
108110 Row {
@@ -123,7 +125,7 @@ Item {
123125 width: parent.labelWidth
124126 elide: Text.ElideRight
125127 font.weight: Font.DemiBold
126− color: Theme.palette.selected.foreground
128+ color: "#ff990000"
127129 visible: text
128130 }
129131
@@ -133,6 +135,8 @@ Item {
133135 width: parent.labelWidth
134136 elide: Text.ElideRight
135137 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
138+ font.strikeout: true
139+ color: "black"
136140 visible: text
137141 }
138142
@@ -141,9 +145,22 @@ Item {
141145 width: parent.labelWidth
142146 elide: Text.ElideRight
143147 horizontalAlignment: Text.AlignRight
148+ color: fontColor
144149 visible: text
145150 }
146151 }
147152 }
148153 }
154+
155+ function getLuminance(color) {
156+ return 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b;
157+ }
158+
159+ // TODO karni: Change "grey" to Ubuntu.Components.Palette color once updated.
160+ function getFontColor(backgroundColor) {
161+ if (inOverlay) return "white";
162+ if (backgroundColor === undefined) return "grey";
163+ var luminance = getLuminance(backgroundColor);
164+ return luminance < 0.7 ? "white" : "grey"
165+ }
149166}