anup-a / meshy

🧞‍♂️ MESH·Y is a design tool to generate beautiful & colorful mesh gradients.
https://meshgradient.in
Other
370 stars 35 forks source link

Make a plug-in? #17

Closed QuarkPixel closed 2 years ago

QuarkPixel commented 2 years ago

I rally rally like this website! In fact, I have never seen code outside Apple that can generate such pictures. Maybe I'm a little superficial, but this is the only place I know so far that I can generate such pictures. So is it possible for this webpage to become a plug-in form that can be directly referenced by others? I tried to carry out this project myself, but I was not familiar with Svelte, so I gave up 😂 I would be very grateful if you could take some time to do this project ❤️

anup-a commented 2 years ago

Hi, @QuarkPixel Thanks.

Can you explain a bit more about your use case?

directly referenced by others

Do you mean a util library that generates a new mesh gradient on demand to inject into your website?

QuarkPixel commented 2 years ago

That's right, I mean just need to refer to one or more js files, and then use this generate function where I need it, and it can be generated where I want to generate it. For example: //generateMeshy(correspondingID,meshID,width,height,color1,color2,color3,color4) generateMeshy('meshyCanvas',238,1920,1080,'#2780c2','#ff00ff','#08f796', #09a654) Then, it can generate picture in canvas with id for "meshyCanvas"

anup-a commented 2 years ago

Here you go https://github.com/anup-a/mesh-gradient.js.

Give it a shot, I have exposed the core code which generates mesh gradient.

As of now, API is not very clean, but feel free to contribute. PRs are always welcome 🙃.