Skip to content

Commit 43ed89a

Browse files
committed
Color save button with background image
1 parent 3a661da commit 43ed89a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/ui/tools/save.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export function uiToolSave(context) {
4242
return null;
4343
} else if (numChanges <= 50) {
4444
step = numChanges / 50;
45-
return d3_interpolateRgb('#fff', '#ff8')(step); // white -> yellow
45+
return d3_interpolateRgb('#fff0', '#ff08')(step); // transparent -> yellow
4646
} else {
4747
step = Math.min((numChanges - 50) / 50, 1.0);
48-
return d3_interpolateRgb('#ff8', '#f88')(step); // yellow -> red
48+
return d3_interpolateRgb('#ff08', '#f008')(step); // yellow -> red
4949
}
5050
}
5151

@@ -62,9 +62,10 @@ export function uiToolSave(context) {
6262
}
6363

6464
if (button) {
65+
var bg = bgColor(_numChanges);
6566
button
6667
.classed('disabled', isDisabled())
67-
.style('background', bgColor(_numChanges));
68+
.style('background-image', `linear-gradient(0, ${bg}, ${bg})` );
6869

6970
button.select('span.count')
7071
.text(_numChanges);

0 commit comments

Comments
 (0)