Get started with chroma-js CDN
Stable version
Copied!
How to start using chroma-js CDN
// Include Chroma.js library
const Chroma = require('chroma-js/dist/chroma.min.js');
// Define the base color
const baseColor = new Chroma('blue');
// Get the hex code of the base color
const baseColorHex = baseColor.hex();
console.log('Base color hex:', baseColorHex);
// Define the amount to shift the color
const shiftAmount = 50;
// Create a new color shifted by the specified amount
const shiftedColor = baseColor.shift(shiftAmount);
// Get the hex code of the new color
const shiftedColorHex = shiftedColor.hex();
console.log('Shifted color hex:', shiftedColorHex);
Copied!
All versions
0.2.5
0.4.10
0.4.11
0.4.12
0.4.3
0.4.7
0.4.8
0.5.1
0.5.2
0.5.4
0.5.5
0.5.6
0.5.7
0.5.8
0.5.9
0.6.0
0.6.1
0.6.2
0.6.3
0.7.1
0.7.2
0.7.3
0.7.4
0.7.5
0.7.6
0.7.8
1.0.1
1.1.0
1.1.1
1.2.1
1.2.2
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.3.6
1.3.7
1.4.0
1.4.1
2.0.0
2.0.1
2.0.2
2.0.3
2.0.4
2.0.5
2.0.6
2.1.0
2.1.1
2.1.2
2.2.0
2.3.0
2.4.0
2.4.1
*** 2.4.2