ZeroOmega/omega-web/img/icons/draw_omega.js
2024-02-29 22:14:04 +08:00

20 lines
507 B
JavaScript

globalThis.drawOmega = function (ctx, outerCircleColor, innerCircleColor) {
ctx.globalCompositeOperation = "source-over";
ctx.fillStyle = outerCircleColor;
ctx.beginPath();
ctx.arc(0.5, 0.5, 0.5, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
if (innerCircleColor != null) {
ctx.fillStyle = innerCircleColor;
} else {
ctx.globalCompositeOperation = "destination-out";
}
ctx.beginPath();
ctx.arc(0.5, 0.5, 0.25, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
};