2

我正在使用https://ui.toast.com/tui-image-editor库进行图像编辑功能,默认情况下有一个颜色选择器组件,我正在尝试更改此颜色的默认颜色-picker,但我找不到这样做的方法,我做了一些研究,看起来这个图像编辑器正在使用https://github.com/nhn/tui.color-picker作为依赖项,所以可能是很难改变颜色的方式。

这是我的代码:

 <ImageEditor ref={this.editorRef} {...imageEditorOptions} 
            includeUI={{
              loadImage: {'image-path'},
              theme: myTheme,
              menu: ['text'],
              initMenu: 'text',
              menuBarPosition: 'bottom',
            }}
            selectionStyle={{
              cornerSize: 20,
              rotatingPointOffset: 70,
            }}
        />

在“myTheme”变量上,我为颜色选择样式设置了一些配置,但它们并没有用于设置其默认颜色,可能是因为它是动态设置的。

'colorpicker.button.border': '1px solid #1e1e1e',
'colorpicker.title.color': '#fff'

我也试过直接在我的页面 CSS 上设置颜色

.tui-image-editor-container .tui-image-editor-main-container {
    bottom: 0 !important;
    top: 0 !important;
    max-height: 450px;
    background-color: red !important;
}
4

0 回答 0