Skip to content

Commit

Permalink
grid color now sets two colors in appstate
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Aug 27, 2023
1 parent e1fe3ee commit 041efca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ExcalidrawView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1782,10 +1782,12 @@ export default class ExcalidrawView extends TextFileView {
});
}

private getGridColor(bgColor: string):string {
private getGridColor(bgColor: string):{Bold: string, Regular: string} {
const cm = this.plugin.ea.getCM(bgColor);
cm.isDark() ? cm.lighterBy(5) : cm.darkerBy(5);
return cm.stringHEX();
const isDark = cm.isDark();
const Regular = (isDark ? cm.lighterBy(5) : cm.darkerBy(5)).stringHEX();
const Bold = (isDark ? cm.lighterBy(10) : cm.darkerBy(10)).stringHEX();
return {Bold, Regular};
}

public activeLoader: EmbeddedFilesLoader = null;
Expand Down

0 comments on commit 041efca

Please sign in to comment.