Gatsby Book Launch

“The missing guide to the modern web” launches on Thursday, Sep 29th: Modular: The Web’s New Architecture

ContactSign Up for Free
Community Plugin
View plugin on GitHub

@fourpost/gatsby-plugin-extract-image-color

Extracts colors from image adds them to the image data

Since DatoCMS doesn’t actually download images during Gatsby builds, we need an additional way to grab image colors. Appending ?palette=json to DatoCMS image URLs returns the color palette, which we add to the GraphQL node.

This is a modified version of gatsby-plugin-extract-image-color

Installation

  1. npm i @fourpost/gatsby-plugin-extract-image-color
  2. Add config to gatsby-config.js
// gatsby-config.js
module.exports = {
  plugins: [
    //... Other plugins
    'gatsby-plugin-extract-image-color'
  ]
}
© 2022 Gatsby, Inc.