WhatsApp Group Join Now
Telegram Group Join Now
Instagram Group Join Now

Color Scheme Generator

TYPE html> Color Scheme Generator

Color Scheme Generator

Base Color

Complementary

Analogous

Triadic

document.getElementById(‘generateScheme’).addEventListener(‘click’, generateColorScheme); function generateColorScheme() { const baseColor = document.getElementById(‘baseColor’).value; const baseColorObj = chroma(baseColor); document.getElementById(‘base’).style.backgroundColor = baseColor; document.getElementById(‘complementary’).style.backgroundColor = baseColorObj.saturate(2).hex(); document.getElementById(‘analogous’).style.backgroundColor = baseColorObj.set(‘hsl.h’, ‘+=30’).hex(); document.getElementById(‘triadic’).style.backgroundColor = baseColorObj.set(‘hsl.h’, ‘+=120’).hex(); }

Leave a Comment