File tree 2 files changed +10
-2
lines changed
project-editor/ui-components/PropertyGrid
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ export function isDark(color: string) {
72
72
return tinycolor ( color ) . isDark ( ) ;
73
73
}
74
74
75
+ export function isLight ( color : string ) {
76
+ return tinycolor ( color ) . isLight ( ) ;
77
+ }
78
+
75
79
export function isValid ( color : string ) {
76
80
return tinycolor ( color ) . isValid ( ) ;
77
81
}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import ReactDOM from "react-dom";
3
3
import { observer } from "mobx-react" ;
4
4
import { SketchPicker } from "react-color" ;
5
5
6
- import { isDark , isValid } from "eez-studio-shared/color" ;
6
+ import { isDark , isLight , isValid } from "eez-studio-shared/color" ;
7
7
8
8
import { getProperty } from "project-editor/core/object" ;
9
9
import { getEezStudioDataFromDragEvent } from "project-editor/store" ;
@@ -197,7 +197,11 @@ export const ThemedColorInput = observer(
197
197
ref = { this . props . inputRef }
198
198
className = "form-control"
199
199
style = { {
200
- color : isDark ( tinycolor ( color ) . toHexString ( ) )
200
+ color : settingsController . isDarkTheme
201
+ ? isLight ( tinycolor ( color ) . toHexString ( ) )
202
+ ? "#000"
203
+ : undefined
204
+ : isDark ( tinycolor ( color ) . toHexString ( ) )
201
205
? "#fff"
202
206
: undefined ,
203
207
backgroundColor : tinycolor ( color ) . toHexString ( )
You can’t perform that action at this time.
0 commit comments