0

How we add color pattern(like that check board)in html webpage using JavaScript

How we add color pattern in html webpage using JavaScript

5th May 2020, 3:51 PM
Ankit Chopra
Ankit Chopra - avatar
1 Antwort
+ 2
Okay. To be honest, i don't really know what you mean by color pattern because it can mean so many things. Try to be specific. Nonetheless, you can use the tag <input type="color"/> to create a color input. Alternatively, you can create a color pattern by using the canvas. Use a for loop to create as many rectangles as you want, but you should set the fillStyles of those rectangles differently by increasing the channels of rgb() In the for loop. Thanks
6th May 2020, 9:12 AM
Mwikisa Kapesa Lufungulo
Mwikisa Kapesa Lufungulo - avatar