<script lang="ts">
  // might rename...
  // no idea what i'm doing...

  import { getContext, onMount } from 'svelte';

  // here you have to export the vars you need to draw this shit...

  const { register, unregister } = getContext('canvas');

  onMount(() => {
    register(draw);

    return () => {
      unregister(draw);
    }
  });

  function draw(ctx) {
    ctx.beginPath();
    ctx.fillStyle = fill;
  }

</script>