Pārlūkot izejas kodu

feat(Options): set default ledger line color to black (instead of grey). set in EngravingRules.LedgerLineColorDefault

inspired by #799
sschmid 4 gadi atpakaļ
vecāks
revīzija
cb31c9817b

+ 8 - 0
src/MusicalScore/Graphical/EngravingRules.ts

@@ -163,6 +163,7 @@ export class EngravingRules {
     private staffLineWidth: number;
     private ledgerLineWidth: number;
     private ledgerLineStrokeStyle: string;
+    private ledgerLineColorDefault: string;
     private wedgeLineWidth: number;
     private tupletLineWidth: number;
     private lyricUnderscoreLineWidth: number;
@@ -424,6 +425,7 @@ export class EngravingRules {
         this.staffLineWidth = 0.12;
         this.ledgerLineWidth = 1; // vexflow units (pixels). if not undefined, the vexflow default will be overwritten
         this.ledgerLineStrokeStyle = undefined; // if not undefined, the vexflow default will be overwritten
+        this.ledgerLineColorDefault = "#000000"; // black, previously grey by default
         this.wedgeLineWidth = 0.12;
         this.tupletLineWidth = 0.12;
         this.lyricUnderscoreLineWidth = 0.12;
@@ -1336,6 +1338,12 @@ export class EngravingRules {
     public set LedgerLineStrokeStyle(value: string) {
         this.ledgerLineStrokeStyle = value;
     }
+    public get LedgerLineColorDefault(): string {
+        return this.ledgerLineColorDefault;
+    }
+    public set LedgerLineColorDefault(value: string) {
+        this.ledgerLineColorDefault = value;
+    }
     public get WedgeLineWidth(): number {
         return this.wedgeLineWidth;
     }

+ 2 - 2
src/MusicalScore/Graphical/VexFlow/VexFlowVoiceEntry.ts

@@ -125,9 +125,9 @@ export class VexFlowVoiceEntry extends GraphicalVoiceEntry {
                     (vfStaveNote as any).setLedgerLineStyle({ fillStyle: noteheadColor, strokeStyle: noteheadColor, lineWidth: this.rules.LedgerLineWidth });
                 } else {
                     (vfStaveNote as any).setLedgerLineStyle({
-                        fillStyle: this.rules.DefaultColorNotehead,
+                        fillStyle: this.rules.LedgerLineColorDefault,
                         lineWidth: this.rules.LedgerLineWidth,
-                        strokeStyle: this.rules.DefaultColorNotehead
+                        strokeStyle: this.rules.LedgerLineColorDefault
                     });
                     // we could give the color (style) as noteheadColor, but then we need to figure out which note has the ledger line.
                     // otherwise ledger lines get the color of the top note, see Function Test Color.