diff options
author | Sophie Zhang <sophie_zhang@brown.edu> | 2023-08-17 17:53:28 -0400 |
---|---|---|
committer | Sophie Zhang <sophie_zhang@brown.edu> | 2023-08-17 17:53:28 -0400 |
commit | def88f33905ae6a1521ca6f36b0863e03effdfba (patch) | |
tree | d007f6a1fd0e843879e3cdc8ddd5c3837123e780 /src/client/views/nodes/ColorBox.tsx | |
parent | 592e1a1b1000157db77bd812b8debfbcc45844f9 (diff) | |
parent | bcada17befd639516862163831b9adb823791a93 (diff) |
Merge branch 'master' into sophie-ai-images
Diffstat (limited to 'src/client/views/nodes/ColorBox.tsx')
-rw-r--r-- | src/client/views/nodes/ColorBox.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
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<FieldViewProps>() { @@ -81,3 +83,10 @@ export class ColorBox extends ViewBoxBaseComponent<FieldViewProps>() { ); } } + + +ScriptingGlobals.add( + function interpColors(c1:string, c2:string, weight=0.5) { + return DashColor(c1).mix(DashColor(c2),weight) + } +)
\ No newline at end of file |