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. Required fields are marked *

2 replies on “Create unlimited color swatches in Verge 3d – Source file included”

  • October 26, 2022 at 7:10 am

    It is the best time to make some plans for the future and it is time to be happy.
    I have read this post and if I could I wish to suggest you few interesting things or advice.
    Perhaps you can write next articles referring to this
    article. I wish to read more things about it!

    • October 26, 2022 at 1:55 pm

      Yes sure i would like to hear that suggestion