mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 15:26:17 -04:00
Fix animation color on older webkit/blink based browsers
This commit is contained in:
parent
b8a973f037
commit
800d492da5
2 changed files with 3 additions and 4 deletions
|
@ -462,8 +462,8 @@ class BackgroundCanvas {
|
||||||
|
|
||||||
if (ctx.setStrokeColor) {
|
if (ctx.setStrokeColor) {
|
||||||
// older blink/webkit browsers do not understand opacity in strokeStyle. Use deprecated setStrokeColor
|
// older blink/webkit browsers do not understand opacity in strokeStyle. Use deprecated setStrokeColor
|
||||||
let baseColorRgb = baseColor.split(" ");
|
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle#webkitblink-specific_note
|
||||||
ctx.setStrokeColor(baseColorRgb[0], baseColorRgb[1], baseColorRgb[2], opacity);
|
ctx.setStrokeColor("grey", opacity);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ctx.strokeStyle = `rgb(${baseColor} / ${opacity})`;
|
ctx.strokeStyle = `rgb(${baseColor} / ${opacity})`;
|
||||||
|
|
|
@ -98,8 +98,7 @@ function drawCircle(ctx, radius) {
|
||||||
if (ctx.setStrokeColor) {
|
if (ctx.setStrokeColor) {
|
||||||
// older blink/webkit based browsers do not understand opacity in strokeStyle. Use deprecated setStrokeColor instead
|
// older blink/webkit based browsers do not understand opacity in strokeStyle. Use deprecated setStrokeColor instead
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle#webkitblink-specific_note
|
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle#webkitblink-specific_note
|
||||||
let baseColorRgb = baseColor.split(" ");
|
ctx.setStrokeColor("grey", opacity);
|
||||||
ctx.setStrokeColor(baseColorRgb[0], baseColorRgb[1], baseColorRgb[2], opacity);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ctx.strokeStyle = `rgb(${baseColor} / ${opacity})`;
|
ctx.strokeStyle = `rgb(${baseColor} / ${opacity})`;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue