@amcharts/amcharts5
Version:
amCharts 5
65 lines • 2.84 kB
JavaScript
import { Color } from "../core/util/Color";
import { Theme } from "../core/Theme";
/**
* "Nord" — the light variant of the Nord palette (Arctic Ice Studio): a cool,
* desaturated, deliberately low-contrast scheme on a "Snow Storm" off-white
* ground, with muted Frost/Aurora accents. Pairs with `NordDark`.
*
* This is a standalone theme; it does not modify any built-in theme.
*
* @see {@link https://www.nordtheme.com/} for the original palette
* @see {@link https://www.amcharts.com/docs/v5/concepts/themes/} for more info
* @important
*/
export class NordTheme extends Theme {
setupDefaultRules() {
super.setupDefaultRules();
const l = Color.lighten;
const primary = Color.fromHex(0x5e81ac); // nord10
const secondary = Color.fromHex(0xe5e9f0); // nord5
this.rule("InterfaceColors").setAll({
stroke: Color.fromHex(0xd8dee9),
fill: Color.fromHex(0xe5e9f0),
primaryButton: primary,
primaryButtonHover: l(primary, -0.1),
primaryButtonDown: l(primary, -0.18),
primaryButtonActive: l(primary, -0.18),
primaryButtonDisabled: Color.fromHex(0xd8dee9),
primaryButtonTextDisabled: Color.fromHex(0xeceff4),
primaryButtonText: Color.fromHex(0xeceff4),
primaryButtonStroke: l(primary, -0.15),
secondaryButton: secondary,
secondaryButtonHover: l(secondary, -0.08),
secondaryButtonDown: l(secondary, -0.13),
secondaryButtonActive: l(secondary, -0.18),
secondaryButtonText: Color.fromHex(0x2e3440),
secondaryButtonStroke: l(secondary, -0.1),
grid: Color.fromHex(0x4c566a),
background: Color.fromHex(0xeceff4),
alternativeBackground: Color.fromHex(0x2e3440),
text: Color.fromHex(0x2e3440),
alternativeText: Color.fromHex(0xeceff4),
disabled: Color.fromHex(0x9aa3b2),
positive: Color.fromHex(0xa3be8c),
negative: Color.fromHex(0xbf616a) // nord11
});
// Deeper Nord hues first so they read on the light ground; the palest
// (yellow) sits later.
this.rule("ColorSet").setAll({
colors: [
Color.fromHex(0x5e81ac),
Color.fromHex(0xebcb8b),
Color.fromHex(0xbf616a),
Color.fromHex(0x88c0d0),
Color.fromHex(0xb56f9b),
Color.fromHex(0xa3be8c),
Color.fromHex(0xb48ead),
Color.fromHex(0x8fbcbb),
Color.fromHex(0xd08770),
Color.fromHex(0x81a1c1) // frost blue
],
reuse: true
});
}
}
//# sourceMappingURL=NordTheme.js.map