Skip to main content

Color Schemes

flowmap.gl includes 40+ built-in color schemes and supports custom color schemes.

Using Color Schemes

Set a color scheme using the colorScheme prop:

new FlowmapLayer({
colorScheme: 'Teal', // Use a preset
// ...
});

Built-in Color Schemes

Sequential Schemes (Single Hue)

NameDescription
BluesLight to dark blue
GreensLight to dark green
GreysLight to dark grey
OrangesLight to dark orange
PurplesLight to dark purple
RedsLight to dark red

Sequential Schemes (Multi-Hue)

NameDescription
BuGnBlue to green
BuPuBlue to purple
GnBuGreen to blue
OrRdOrange to red
PuBuPurple to blue
PuBuGnPurple to blue to green
PuRdPurple to red
RdPuRed to purple
YlGnYellow to green
YlGnBuYellow to green to blue
YlOrBrYellow to orange to brown
YlOrRdYellow to orange to red

Custom Sequential Schemes

NameDescription
TealDefault scheme. Teal shades (light to dark)
BluGrnBlue-green gradient
BluYlBlue to yellow
BrwnYlBrown to yellow
BurgBurgundy shades
BurgYlBurgundy to yellow
DarkMintDark mint green shades
EmrldEmerald green shades
MagentaMagenta shades
MintMint green shades
OrYelOrange to yellow
PeachPeach shades
PinkYlPink to yellow
PurpPurple shades
PurpOrPurple to orange
RedOrRed to orange
SunsetSunset colors
SunsetDarkDark sunset colors
TealGrnTeal to green

Perceptually Uniform Schemes

These schemes maintain perceptual uniformity:

NameDescription
ViridisPurple to green to yellow
MagmaBlack to purple to yellow
InfernoBlack to red to yellow
PlasmaPurple to pink to yellow
CoolCyan to magenta
WarmOrange to pink to purple

Other Schemes

NameDescription
GrayishLight gray to dark blue-gray

Dark Mode Behavior

When darkMode: true, the color scheme is automatically reversed so that higher values appear brighter (lighter colors).

// In dark mode, the scheme automatically inverts
new FlowmapLayer({
darkMode: true,
colorScheme: 'Teal', // Higher flows will be lighter teal
// ...
});

// In light mode, higher flows will be darker teal
new FlowmapLayer({
darkMode: false,
colorScheme: 'Teal',
// ...
});

Custom Color Schemes

Provide a custom array of colors:

// Custom 7-color scheme
new FlowmapLayer({
colorScheme: [
'#f7fbff', // Lowest values
'#deebf7',
'#c6dbef',
'#9ecae1',
'#6baed6',
'#3182bd',
'#08519c', // Highest values
],
// ...
});

Color Format

Colors can be specified in any CSS color format:

// Hex colors
colorScheme: ['#ffffff', '#000000']

// Named colors
colorScheme: ['white', 'black']

// RGB
colorScheme: ['rgb(255, 255, 255)', 'rgb(0, 0, 0)']

// RGBA (with transparency)
colorScheme: ['rgba(255, 255, 255, 0.5)', 'rgba(0, 0, 0, 1)']

For best results, provide 5-9 colors. The library interpolates between these colors to create smooth gradients.

Fading Effects

The fadeAmount prop controls how much lower-magnitude flows fade:

new FlowmapLayer({
colorScheme: 'Teal',
fadeAmount: 50, // Default: moderate fading
fadeEnabled: true, // Enable color fading
fadeOpacityEnabled: false, // Also fade opacity (optional)
// ...
});
PropDefaultDescription
fadeAmount500-100: How much lower flows fade (0 = no fade, 100 = maximum fade)
fadeEnabledtrueWhether to apply color fading
fadeOpacityEnabledfalseWhether to also fade opacity

Example: Comparing Schemes

// Create multiple layers with different schemes
const schemes = ['Teal', 'Blues', 'Viridis', 'Sunset'];

schemes.forEach((scheme, index) => {
const layer = new FlowmapLayer({
id: `flowmap-${scheme}`,
data,
colorScheme: scheme,
// Offset each layer for comparison
// ...
});
});

Creating Brand Colors

Match your brand colors by creating a custom scheme:

// Example: Using brand colors
const brandColors = [
'rgba(240, 240, 240, 0.5)', // Near white for lowest
'#b3d4fc', // Light brand blue
'#6699cc', // Medium brand blue
'#336699', // Brand blue
'#003366', // Dark brand blue for highest
];

new FlowmapLayer({
colorScheme: brandColors,
// ...
});

Here are some popular combinations:

For Geographic/Nature Data

  • Teal - Calm, water-like
  • Emrld - Nature, environment
  • BluGrn - Ocean currents, ecology

For Business/Analytics

  • Blues - Professional, neutral
  • Greys - Minimal, understated
  • Grayish - Corporate, formal

For Impact/Attention

  • Reds - Urgency, heat
  • Oranges - Energy, activity
  • Sunset - Dramatic, warm

For Scientific Data

  • Viridis - Perceptually uniform, colorblind-friendly
  • Plasma - High contrast, scientific
  • Magma - Heat maps, intensity