All Projects β†’ trevorblades β†’ color-loader

trevorblades / color-loader

Licence: other
🎨 A webpack loader that extracts the color palette of an image

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to color-loader

Colors App
🎨 A PWA for copying values from popular color palettes. Supports HEX, RGB, and HSL formats.
Stars: ✭ 90 (+542.86%)
Mutual labels:  color, color-palette
colors
A gorgeous, accessible color system.
Stars: ✭ 748 (+5242.86%)
Mutual labels:  color, color-palette
Colorbook
🎨 Color schemes for UI design - Optimized for foreground, background, border, etc. https://liyasthomas.github.io/colorbook
Stars: ✭ 148 (+957.14%)
Mutual labels:  color, color-palette
Colorschemes.jl
colorschemes, colormaps, gradients, and palettes
Stars: ✭ 55 (+292.86%)
Mutual labels:  color, color-palette
SwiftColorWheel
Delightful color picker wheel for iOS in Swift.
Stars: ✭ 37 (+164.29%)
Mutual labels:  color, color-palette
Iconhandler
Tint you Icons, change the size, apply alpha color and set a position easily. πŸ‘“
Stars: ✭ 59 (+321.43%)
Mutual labels:  color, color-palette
pantone-colors
Hex values of all 2310 Pantone colors
Stars: ✭ 147 (+950%)
Mutual labels:  color, color-palette
R Color Palettes
Comprehensive list of color palettes available in r β€οΈπŸ§‘πŸ’›πŸ’šπŸ’™πŸ’œ
Stars: ✭ 708 (+4957.14%)
Mutual labels:  color, color-palette
quickpalette
πŸƒβ€β™€οΈπŸŽ¨ R package for quick extraction of color palettes from text and images
Stars: ✭ 24 (+71.43%)
Mutual labels:  color, color-palette
react-native-color-panel
React Native Color Panel Component for iOS and Android πŸ³οΈβ€πŸŒˆ
Stars: ✭ 21 (+50%)
Mutual labels:  color, color-palette
Materialdesigncolor
This project shows the color in material design
Stars: ✭ 55 (+292.86%)
Mutual labels:  color, color-palette
imgpalr
R package for generating color palettes from arbitrary images.
Stars: ✭ 44 (+214.29%)
Mutual labels:  color, color-palette
Leonardo
Generate colors based on a desired contrast ratio
Stars: ✭ 973 (+6850%)
Mutual labels:  color, color-palette
Gvcci
color extraction to turn images into 16 color palettes
Stars: ✭ 86 (+514.29%)
Mutual labels:  color, color-palette
Kallewheel
A custom color wheel extension for Adobe Photoshop
Stars: ✭ 16 (+14.29%)
Mutual labels:  color, color-palette
Colors.lol
🎨 Overly descriptive color palettes
Stars: ✭ 207 (+1378.57%)
Mutual labels:  color, color-palette
Pickr
🎨 Flat, simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!
Stars: ✭ 3,759 (+26750%)
Mutual labels:  color, color-palette
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (+3000%)
Mutual labels:  color, color-palette
react-native-image-color-picker
Image color picker based on image source provided and return image different color palettes or average color palette
Stars: ✭ 25 (+78.57%)
Mutual labels:  color, color-palette
hcv-color
🌈 Color model HCV/HCG is an alternative to HSV and HSL, derived by Munsell color system, usable for Dark and Light themes... 🌈
Stars: ✭ 44 (+214.29%)
Mutual labels:  color, color-palette

Color Loader

Build Status

A webpack loader that extracts the color palette of an image

Installation

$ npm install --save-dev color-loader file-loader

This loader depends on file-loader, so be sure to install that too if you don't have it already.

Usage

This loader supports JPEG, PNG, GIF, and SVG files and is designed to be a drop-in replacement for file-loader, in case you're already using that. The loader will output the path to the provided image file, along with information about the colors in the image.

import image, {color, colors} from 'color-loader!./path/to/image.jpg';
  • image is the image path generated by the file loader
  • color is the most dominant color in the image
  • colors is an array of the dominant colors in the image

You can use it in your webpack configuration, too! This means that all images that you import or require will always return the colors extracted from the image.

{
  // ...your awesome webpack config options
  module: {
    rules: [
      {
        test: /\.(jpg|png|gif|svg)$/,
        use: 'color-loader'
      }
    ]
  }
}

Options

You can pass along any options you would normally pass to file-loader.

Example

This image:

example image

Will result in these colors:

  • #3a4f25 #3a4f25
  • #b37a5d #b37a5d
  • #78993b #78993b
  • #839795 #839795
  • #8c472f #8c472f

You could use it in a React component like this:

import image, {color} from './example.png';

const Component = () => (
 <div
   style={{
     backgroundColor: color, // #3a4f25
     backgroundImage: image
   }}
 >
   <h1>They ate the PokΓ©mon...</h1>
 </div>
);

And it might look something like this (results may vary):

example gif

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].