GamutDesk Logo
GamutDesk

SCSS / SASS Color Map & Variables Generator

Generate SCSS color variables and a $colors map from named HEX colors, ready for map-get(). Instant output you can paste into any Sass project.

Client-Side ArchitecturePrivate Client-Side Processing

Colors (5/12)

Output

SCSS variables and map
$primary: #2563EB;
$secondary: #7C3AED;
$success: #16A34A;
$warning: #F59E0B;
$surface: #F8FAFC;

$colors: (
  "primary": #2563EB,
  "secondary": #7C3AED,
  "success": #16A34A,
  "warning": #F59E0B,
  "surface": #F8FAFC
);

// Usage: color: map-get($colors, "primary");

Technical Specification & Mathematical Principles

How the SCSS Variables Generator Works

Sass variables start with a dollar sign: $primary: #3B82F6;. A Sass map groups values by key: $colors: ("primary": #3B82F6, "surface": #FFFFFF);. Values are retrieved with map-get($colors, "primary"), or with map.get after @use "sass:map".

The generator emits both forms from the same list. Names are normalized to lowercase hyphenated keys, duplicates are numbered, and trailing commas are handled so the output compiles without edits.

Frequently Asked Questions

Should I use variables or a map?
Individual variables are easiest for direct use. A map lets you loop with @each to generate utility classes or CSS custom properties, which keeps the palette in one place.
Does it work with the Sass module system?
Yes. Put the output in a partial such as _colors.scss and load it with @use. Use map.get($colors, "primary") after @use "sass:map".
Why are map keys quoted?
Quoted keys are strings, which avoids ambiguity with color names such as red or blue that Sass would otherwise treat as color values.

Related Design & Color Instruments