Create unlimited color swatches in Verge 3D

Live preview : https://v3d.net/9o4

Hi, in this tutorial we are going to create the colors swatches in an efficient way we just have to pass the color code and it will create a new color swatch for us 😄 

I created a function for it so you can use it in the future easily so i am looping the puzzles based on the number of color codes you pased and then i am creating a html element and assigning with a CSS class and background and then i am pushing the created elements to an empty array so we can access it later and once they are created now we need to apply event listener to all created element and assigning the clicked element background to your material 

Verge 3d puzzles tutorial
It’s done now just pass the values and it will start working

I am WebGL and verge 3d developer, i love to share my knowledge and experience with other people

Leave a Reply

Your email address will not be published.