Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
Search

Articles Tagged
hex

3 Articles
{
,

}
Direct link to the article Converting Color Spaces in JavaScript
color generative color hex hsl rgba

Converting Color Spaces in JavaScript

A challenge I faced in building an image “emojifier” was that I needed to change the color spaces of values obtained using getImageData() from RGB to HSL. I used arrays of emojis arranged by brightness and saturation, and they were …

Avatar of Jon Kantner
Jon Kantner on Jan 10, 2019 (Updated on Jan 26, 2021)
Direct link to the article 8-Digit Hex Codes?
color hex

8-Digit Hex Codes?

Weird right? 4-digit hex codes too. They are a way put alpha transparency information into the hex format for colors. You might be seeing it more all the sudden if you use Chrome, because it dropped in 52, and …

Avatar of Chris Coyier
Chris Coyier on Sep 8, 2016 (Updated on Sep 13, 2016)
Direct link to the article How To Generate a Random Color in JavaScript
color hex random

How To Generate a Random Color in JavaScript

Here’s a quicky (there is a PHP version too):

var randomColor = Math.floor(Math.random()*16777215).toString(16);

If you’d prefer they are a bit more …

Avatar of Chris Coyier
Chris Coyier on Dec 10, 2009 (Updated on Feb 19, 2020)

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways hosting
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Write for us!
  • Advertise with us
  • Contact us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • X
Back to Top