Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const hexToRgb = h => /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(h).slice(1).map(i=>parseInt(i,16))
- const rgbToHex = (r,g,b) => '#'+((1<<24)+(r<<16)+(g<<8)+b).toString(16).slice(1)
- //Random Hex Color
- (λ=>`#${λ.replace(/./g,h=>(Math[λ]()*0x10|0).toString(0x10))}`)('random')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement