Spotify like dynamic gradient background based on image colours

Image: Spotify like dynamic gradient background based on image colours GIF

Ever wanted that dynamic background gradient colour that comes up in Spotify? Now you can get that same effect for you images with this pure CSS snippet. As you can see below, depending on the image there is a background gradient glow around that image using the primary colours of that image.

If you like this you might like more of our deconstruction snippets.

If you are having trouble with the pen, try the archived copy on GitHub and here is the one with 2 images side by side.

Spotify Background Gradient Snippet

See the Pen eYYvwWb by Saijo George (@SaijoGeorge) on CodePen.0

See the Pen GRRWWze by botch (@plasmatic) on CodePen.0

Posted by:Saijo George

Digital Marketer with a strong focus on technical SEO and design. One of the top 100 makers on Producthunt, co-organizer of the SEO Meetup in Melbourne, an instructor at General Assembly. Worked with brands like Envato, AEON. Currently the SEO Strategy Director at Supple.