How can I create custom polygon?

Of course, here is it
https://codepen.io/bersonazh/pen/JjWRLqR

While I was doing a sketch, i don’t undestand how, but it now draws correct lines. So pls can you say what should I use, to fill it with color?

I thought about shape, but I need it to be conversed to sphere coords