From 02a540ce4cd8374956245f23cfeffa8eebbaa012 Mon Sep 17 00:00:00 2001 From: geireann Date: Tue, 15 Aug 2023 14:55:57 -0400 Subject: fixed inking strokes to not recompute fill and stroke color for each re-render. --- src/client/views/nodes/ColorBox.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/client/views/nodes/ColorBox.tsx') diff --git a/src/client/views/nodes/ColorBox.tsx b/src/client/views/nodes/ColorBox.tsx index aae759702..1b6fe5748 100644 --- a/src/client/views/nodes/ColorBox.tsx +++ b/src/client/views/nodes/ColorBox.tsx @@ -14,6 +14,8 @@ import { ActiveInkColor, ActiveInkWidth, SetActiveInkColor, SetActiveInkWidth } import './ColorBox.scss'; import { FieldView, FieldViewProps } from './FieldView'; import { RichTextMenu } from './formattedText/RichTextMenu'; +import { ScriptingGlobals } from '../../util/ScriptingGlobals'; +import { DashColor } from '../../../Utils'; @observer export class ColorBox extends ViewBoxBaseComponent() { @@ -81,3 +83,10 @@ export class ColorBox extends ViewBoxBaseComponent() { ); } } + + +ScriptingGlobals.add( + function interpColors(c1:string, c2:string, weight=0.5) { + return DashColor(c1).mix(DashColor(c2),weight) + } +) \ No newline at end of file -- cgit v1.2.3-70-g09d2