Skip to content

Commit

Permalink
feat(dark): support custom dark map
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovilia committed Aug 21, 2024
1 parent 5c86209 commit a47077f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/canvas/Painter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export default class CanvasPainter implements PainterBase {
}

paintOne(ctx: CanvasRenderingContext2D, el: Displayable) {
brushSingle(ctx, el, this._opts.darkMode);
brushSingle(ctx, el, this._opts.darkMode, this._opts.darkColorMap);
}

private _paintList(list: Displayable[], prevList: Displayable[], paintAll: boolean, redrawId?: number) {
Expand Down
4 changes: 2 additions & 2 deletions src/canvas/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ function getStyle(el: Displayable, inHover?: boolean) {
export function brushSingle(
ctx: CanvasRenderingContext2D,
el: Displayable,
darkMode: boolean,
darkColorMap: Dictionary<string>
darkMode?: boolean,
darkColorMap?: Dictionary<string>
) {
const scope: BrushScope = {
inHover: false,
Expand Down

0 comments on commit a47077f

Please sign in to comment.