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

Articles Tagged
color

36 Articles
{
,

}
Direct link to the article Lighten / Darken Color
color

Lighten / Darken Color

The CSS preprocessors Sass and Less can take any color and darken() or lighten() it by a specific value. But no such ability is built into JavaScript. This function takes colors in hex format (i.e. #F06D06, with or without hash) …

Avatar of Chris Coyier
Chris Coyier on Jan 1, 2013 (Updated on Jan 20, 2020)
Direct link to the article RGBa Browser Support
color rgba

RGBa Browser Support

This article was originally published on February 2, 2009 and is now being updated to clarify the concept and update the information for modern browsers.

RGBa is a way to declare a color in CSS that includes alpha transparency support. …

Avatar of Chris Coyier
Chris Coyier on May 19, 2010 (Updated on Sep 28, 2018)
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);

See the Pen
Generate New Random Hex Color with JavaScript
by Chris Coyier (@chriscoyier)
on CodePen.

If you’d prefer they are a bit more …

Avatar of Chris Coyier
Chris Coyier on Dec 10, 2009 (Updated on Feb 19, 2020)
  • Newer
  • 1
  • ...
  • 2
  • 3
  • 4

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