Skip to content

Commit

Permalink
#154 trweaking some more, state diagram composit backgrounds
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Jul 20, 2020
1 parent 3a6915c commit ffaf6c1
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/diagrams/state/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ g.stateGroup line {
fill: ${options.background};
}
.statediagram-cluster.statediagram-cluster-alt .inner {
fill: '#e0e0e0';
fill: #e0e0e0;
}
.statediagram-cluster .inner {
Expand Down
2 changes: 1 addition & 1 deletion src/themes/state.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ g.stateGroup line {
}

.statediagram-cluster rect {
fill: $nodeBkg;
// fill: $nodeBkg;
stroke: $nodeBorder;
stroke-width: 1px;
}
Expand Down
13 changes: 12 additions & 1 deletion src/themes/theme-dark.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { invert, lighten, darken, rgba } from 'khroma';
import { invert, lighten, darken, rgba, adjust } from 'khroma';

class Theme {
constructor() {
this.background = '#333';
this.primaryColor = '#1f2020';
this.secondaryColor = lighten(this.primaryColor, 16);
this.mainBkg = '#1f2020';
this.secondBkg = 'calculated';
this.mainContrastColor = 'lightgrey';
Expand Down Expand Up @@ -115,6 +117,15 @@ class Theme {
/* state colors */
this.labelColor = this.textColor;
this.altBackground = lighten(this.background, 20);

this.fillType0 = this.primaryColor;
this.fillType1 = this.secondaryColor;
this.fillType2 = adjust(this.primaryColor, { h: 64 });
this.fillType3 = adjust(this.secondaryColor, { h: 64 });
this.fillType4 = adjust(this.primaryColor, { h: -64 });
this.fillType5 = adjust(this.secondaryColor, { h: -64 });
this.fillType6 = adjust(this.primaryColor, { h: 128 });
this.fillType7 = adjust(this.secondaryColor, { h: 128 });
/* class */
this.classText = this.nodeBorder;
}
Expand Down
13 changes: 12 additions & 1 deletion src/themes/theme-default.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { lighten, rgba } from 'khroma';
import { lighten, rgba, adjust } from 'khroma';

class Theme {
constructor() {
/* Base variables */
this.primaryColor = '#ECECFF';
this.secondaryColor = '#ffffde';
this.background = 'white';
this.mainBkg = '#ECECFF';
this.secondBkg = '#ffffde';
Expand Down Expand Up @@ -123,6 +125,15 @@ class Theme {
/* state colors */
/* class */
this.classText = this.nodeBorder;
/* journey */
this.fillType0 = this.primaryColor;
this.fillType1 = this.secondaryColor;
this.fillType2 = adjust(this.primaryColor, { h: 64 });
this.fillType3 = adjust(this.secondaryColor, { h: 64 });
this.fillType4 = adjust(this.primaryColor, { h: -64 });
this.fillType5 = adjust(this.secondaryColor, { h: -64 });
this.fillType6 = adjust(this.primaryColor, { h: 128 });
this.fillType7 = adjust(this.secondaryColor, { h: 128 });
}
calculate(overrides) {
if (typeof overrides !== 'object') {
Expand Down
13 changes: 12 additions & 1 deletion src/themes/theme-forest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { darken } from 'khroma';
import { darken, adjust } from 'khroma';
class Theme {
constructor() {
/* Base vales */
this.primaryColor = '#cde498';
this.secondaryColor = '#cdffb2';
this.background = 'white';
this.mainBkg = '#cde498';
this.secondBkg = '#cdffb2';
Expand Down Expand Up @@ -98,6 +100,15 @@ class Theme {
/* state colors */
/* class */
this.classText = this.nodeBorder;
/* journey */
this.fillType0 = this.primaryColor;
this.fillType1 = this.secondaryColor;
this.fillType2 = adjust(this.primaryColor, { h: 64 });
this.fillType3 = adjust(this.secondaryColor, { h: 64 });
this.fillType4 = adjust(this.primaryColor, { h: -64 });
this.fillType5 = adjust(this.secondaryColor, { h: -64 });
this.fillType6 = adjust(this.primaryColor, { h: 128 });
this.fillType7 = adjust(this.secondaryColor, { h: 128 });
}
calculate(overrides) {
if (typeof overrides !== 'object') {
Expand Down
15 changes: 13 additions & 2 deletions src/themes/theme-neutral.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { darken, lighten } from 'khroma';
import { darken, lighten, adjust } from 'khroma';

// const Color = require ( 'khroma/dist/color' ).default
// Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => "#EAF2FB"

class Theme {
constructor() {
this.primaryColor = '#eee';
this.contrast = '#26a';
this.secondaryColor = lighten(this.contrast, 55);
this.background = 'white';
this.mainBkg = '#eee';
this.contrast = '#26a';
this.secondBkg = 'calculated';
this.lineColor = '#666';
this.border1 = '#999';
Expand Down Expand Up @@ -130,6 +132,15 @@ class Theme {
/* state colors */
/* class */
this.classText = this.nodeBorder;
/* journey */
this.fillType0 = this.primaryColor;
this.fillType1 = this.secondaryColor;
this.fillType2 = adjust(this.primaryColor, { h: 64 });
this.fillType3 = adjust(this.secondaryColor, { h: 64 });
this.fillType4 = adjust(this.primaryColor, { h: -64 });
this.fillType5 = adjust(this.secondaryColor, { h: -64 });
this.fillType6 = adjust(this.primaryColor, { h: 128 });
this.fillType7 = adjust(this.secondaryColor, { h: 128 });
}
calculate(overrides) {
if (typeof overrides !== 'object') {
Expand Down

0 comments on commit ffaf6c1

Please sign in to comment.