From 353b62aa0abb770474897cf684f86ef7f484087c Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Thu, 22 Sep 2022 11:51:42 -0700 Subject: [PATCH] themes: define properties for ER diagrams, use the (old) hardcoded values --- src/themes/theme-base.js | 16 ++++++++++++++++ src/themes/theme-dark.js | 18 +++++++++++++++++- src/themes/theme-default.js | 15 +++++++++++++++ src/themes/theme-forest.js | 16 ++++++++++++++++ src/themes/theme-neutral.js | 15 +++++++++++++++ 5 files changed, 79 insertions(+), 1 deletion(-) diff --git a/src/themes/theme-base.js b/src/themes/theme-base.js index 0de370f0a..557774030 100644 --- a/src/themes/theme-base.js +++ b/src/themes/theme-base.js @@ -1,5 +1,11 @@ import { darken, lighten, adjust, invert } from 'khroma'; import { mkBorder } from './theme-helpers'; +import { + oldAttributeBackgroundColorEven, + oldAttributeBackgroundColorOdd, + oldAttributeBoxTextColor, +} from './erDiagram-oldHardcodedValues'; + class Theme { constructor() { /** # Base variables */ @@ -219,6 +225,16 @@ class Theme { this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + + /* -------------------------------------------------- */ + /* EntityRelationship diagrams */ + + this.attributeTextColor = this.attributeTextColor || oldAttributeBoxTextColor; + this.attributeBackgroundColorOdd = + this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = + this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + /* -------------------------------------------------- */ } calculate(overrides) { if (typeof overrides !== 'object') { diff --git a/src/themes/theme-dark.js b/src/themes/theme-dark.js index a8b4c5477..d27ddd17b 100644 --- a/src/themes/theme-dark.js +++ b/src/themes/theme-dark.js @@ -1,5 +1,11 @@ import { invert, lighten, darken, rgba, adjust } from 'khroma'; import { mkBorder } from './theme-helpers'; +import { + oldAttributeBackgroundColorEven, + oldAttributeBackgroundColorOdd, + oldAttributeBoxTextColor, +} from './erDiagram-oldHardcodedValues'; + class Theme { constructor() { this.background = '#333'; @@ -28,8 +34,8 @@ class Theme { this.fontSize = '16px'; this.labelBackground = '#181818'; this.textColor = '#ccc'; - /* Flowchart variables */ + /* Flowchart variables */ this.nodeBkg = 'calculated'; this.nodeBorder = 'calculated'; this.clusterBkg = 'calculated'; @@ -218,6 +224,16 @@ class Theme { this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + + /* -------------------------------------------------- */ + /* EntityRelationship diagrams */ + + this.attributeTextColor = this.attributeTextColor || oldAttributeBoxTextColor; + this.attributeBackgroundColorOdd = + this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = + this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + /* -------------------------------------------------- */ } calculate(overrides) { if (typeof overrides !== 'object') { diff --git a/src/themes/theme-default.js b/src/themes/theme-default.js index 0d7939618..f6233f4e2 100644 --- a/src/themes/theme-default.js +++ b/src/themes/theme-default.js @@ -1,5 +1,10 @@ import { invert, lighten, rgba, adjust, darken } from 'khroma'; import { mkBorder } from './theme-helpers'; +import { + oldAttributeBackgroundColorEven, + oldAttributeBackgroundColorOdd, + oldAttributeBoxTextColor, +} from './erDiagram-oldHardcodedValues'; class Theme { constructor() { @@ -257,6 +262,16 @@ class Theme { this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + + /* -------------------------------------------------- */ + /* EntityRelationship diagrams */ + + this.attributeTextColor = this.attributeTextColor || oldAttributeBoxTextColor; + this.attributeBackgroundColorOdd = + this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = + this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + /* -------------------------------------------------- */ } calculate(overrides) { if (typeof overrides !== 'object') { diff --git a/src/themes/theme-forest.js b/src/themes/theme-forest.js index 7f2566de3..439e5f6c1 100644 --- a/src/themes/theme-forest.js +++ b/src/themes/theme-forest.js @@ -1,5 +1,11 @@ import { darken, lighten, adjust, invert } from 'khroma'; import { mkBorder } from './theme-helpers'; +import { + oldAttributeBackgroundColorEven, + oldAttributeBackgroundColorOdd, + oldAttributeBoxTextColor, +} from './erDiagram-oldHardcodedValues'; + class Theme { constructor() { /* Base vales */ @@ -219,6 +225,16 @@ class Theme { this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + + /* -------------------------------------------------- */ + /* EntityRelationship diagrams */ + + this.attributeTextColor = this.attributeTextColor || oldAttributeBoxTextColor; + this.attributeBackgroundColorOdd = + this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = + this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + /* -------------------------------------------------- */ } calculate(overrides) { if (typeof overrides !== 'object') { diff --git a/src/themes/theme-neutral.js b/src/themes/theme-neutral.js index 9c1ad5d1b..3c43a73f4 100644 --- a/src/themes/theme-neutral.js +++ b/src/themes/theme-neutral.js @@ -1,5 +1,10 @@ import { invert, darken, lighten, adjust } from 'khroma'; import { mkBorder } from './theme-helpers'; +import { + oldAttributeBackgroundColorEven, + oldAttributeBackgroundColorOdd, + oldAttributeBoxTextColor, +} from './erDiagram-oldHardcodedValues'; // const Color = require ( 'khroma/dist/color' ).default // Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => "#EAF2FB" @@ -261,6 +266,16 @@ class Theme { this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + + /* -------------------------------------------------- */ + /* EntityRelationship diagrams */ + + this.attributeTextColor = this.attributeTextColor || oldAttributeBoxTextColor; + this.attributeBackgroundColorOdd = + this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = + this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + /* -------------------------------------------------- */ } calculate(overrides) { if (typeof overrides !== 'object') {