Export a Color Palette From Any Image as CSS or Tailwind Config
Table of Contents
Getting brand colors or inspiration palette colors into a CSS or Tailwind project normally means identifying hex codes manually and typing them into variables one by one. The color extractor streamlines this: drop your image, click export, paste the result. No manual transcription. No risk of mistyping a hex code. Here is the exact workflow.
Why manual color entry wastes time and causes errors
Typing hex codes is error-prone. #4A90E2 and #4A90E3 look identical in CSS but produce a noticeable difference in some contexts. Transcribing 6 to 8 brand colors manually takes 3-5 minutes and produces at least one typo on average.
The extract-and-export workflow eliminates both problems: the extractor reads the exact pixel values from the image and writes the hex codes directly into a file. Copy once, paste once, done.
Step-by-step: Extract and export as CSS custom properties
Open the Kingfisher Color Extractor and drop your image. After extraction completes, click "Export CSS." The download contains:
:root {
--color-1: #1A3A6E;
--color-2: #E8572A;
--color-3: #F4F0EB;
--color-4: #2D6A4F;
--color-5: #C9A227;
--color-6: #E9ECE4;
--color-7: #3D405B;
--color-8: #F2CC8F;
}
Paste this into your project's CSS file or design token file, then rename the variables to match your naming convention: --brand-primary, --brand-secondary, --bg-light, etc.
Sell Custom Apparel — We Handle Printing & Free ShippingStep-by-step: Extract and export as Tailwind CSS config
Click "Export Tailwind" to download a Tailwind config object. The output looks like:
module.exports = {
theme: {
extend: {
colors: {
brand: {
1: '#1A3A6E',
2: '#E8572A',
3: '#F4F0EB',
4: '#2D6A4F',
5: '#C9A227',
6: '#E9ECE4',
7: '#3D405B',
8: '#F2CC8F',
}
}
}
}
}
Paste the colors object into your existing tailwind.config.js or tailwind.config.ts in the extend.colors section. Rename the numeric keys to semantic names: primary, secondary, accent, muted, etc. Then use as utility classes: bg-brand-primary, text-brand-secondary.
Color naming conventions that scale across a project
After extraction, rename colors semantically rather than by number or by the extracted hex. Semantic names stay meaningful as the palette evolves:
- Functional: --color-primary, --color-secondary, --color-accent, --color-background, --color-surface, --color-text
- Role-based: --brand-blue, --brand-orange, --neutral-light, --neutral-dark
- Descriptive: --sky-blue, --warm-sand, --deep-forest — useful when working with a visual design language
Avoid: --color-1, --color-hex-1a3a6e, --first-color — these create maintenance problems when the palette changes.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Extract Colors FreeFrequently Asked Questions
Can I use the exported CSS in a SCSS/Sass project?
Yes. CSS custom properties work in Sass/SCSS files. Alternatively, convert the CSS variables to Sass variables by replacing -- with $ and removing the :root wrapper.
Does the Tailwind export work with Tailwind v4?
The export format uses the standard Tailwind v3 config structure (module.exports object). For Tailwind v4, which uses CSS-native configuration, paste the hex values directly into your CSS file as CSS custom properties using the Tailwind v4 theme syntax.

