@amcharts/amcharts5
Version:
amCharts 5
64 lines • 2.79 kB
JavaScript
import { Color } from "../core/util/Color";
import { Theme } from "../core/Theme";
/**
* "Nord Dark" — the dark variant of the Nord palette (Arctic Ice Studio): muted
* Frost/Aurora accents on the deep "Polar Night" `#2e3440` ground. Cool and
* deliberately low-contrast. Pairs with `Nord`.
*
* 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 NordDarkTheme extends Theme {
setupDefaultRules() {
super.setupDefaultRules();
const l = Color.lighten;
const primary = Color.fromHex(0x5e81ac); // nord10
const secondary = Color.fromHex(0x3b4252); // nord1
this.rule("InterfaceColors").setAll({
stroke: Color.fromHex(0x2e3440),
fill: Color.fromHex(0x3b4252),
primaryButton: primary,
primaryButtonHover: l(primary, 0.12),
primaryButtonDown: l(primary, 0.2),
primaryButtonActive: l(primary, 0.2),
primaryButtonDisabled: Color.fromHex(0x434c5e),
primaryButtonTextDisabled: Color.fromHex(0x7b88a1),
primaryButtonText: Color.fromHex(0xeceff4),
primaryButtonStroke: l(primary, 0.1),
secondaryButton: secondary,
secondaryButtonHover: l(secondary, 0.08),
secondaryButtonDown: l(secondary, 0.13),
secondaryButtonActive: l(secondary, 0.18),
secondaryButtonText: Color.fromHex(0xd8dee9),
secondaryButtonStroke: l(secondary, -0.2),
grid: Color.fromHex(0xd8dee9),
background: Color.fromHex(0x2e3440),
alternativeBackground: Color.fromHex(0xeceff4),
text: Color.fromHex(0xd8dee9),
alternativeText: Color.fromHex(0x2e3440),
disabled: Color.fromHex(0x4c566a),
positive: Color.fromHex(0xa3be8c),
negative: Color.fromHex(0xbf616a) // nord11
});
// Muted Frost/Aurora accents, bright enough to read on Polar Night.
this.rule("ColorSet").setAll({
colors: [
Color.fromHex(0x88c0d0),
Color.fromHex(0xbf616a),
Color.fromHex(0xd8dee9),
Color.fromHex(0xd08770),
Color.fromHex(0xebcb8b),
Color.fromHex(0x81a1c1),
Color.fromHex(0xa3be8c),
Color.fromHex(0xb48ead),
Color.fromHex(0x8fbcbb),
Color.fromHex(0x9ab4d4) // light frost
],
reuse: true
});
}
}
//# sourceMappingURL=NordDarkTheme.js.map