themes: define properties for ER diagrams, use the (old) hardcoded values

This commit is contained in:
Ashley Engelund (weedySeaDragon @ github) 2022-09-22 11:51:42 -07:00
parent 826cd67cc8
commit 353b62aa0a
5 changed files with 79 additions and 1 deletions

View file

@ -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') {

View file

@ -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') {

View file

@ -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') {

View file

@ -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') {

View file

@ -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') {