Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

437
Vistas
How to change the tui-color-picker default color using @toast-ui/react-image-editor?

I'm using the https://ui.toast.com/tui-image-editor library for a image edition functionality, there's a color picker component that comes by default there, I'm trying to change the default color of this color-picker but I can't find a way to do that, I've done some research and looks like this image-editor is using https://github.com/nhn/tui.color-picker as a dependency, so that may be way it's so hard to change the color.

Here's my code:

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

On the "myTheme" variable I've setup some configurations for the color-pick style, but they haven't been working for setting its default color, probably because it's setup dynamically.

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

I've also tried setting up the color directly on my page CSS

.tui-image-editor-container .tui-image-editor-main-container {
    bottom: 0 !important;
    top: 0 !important;
    max-height: 450px;
    background-color: red !important;
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

there is currently no option to change the default colors of the color picker, refer here: https://github.com/nhn/tui.image-editor/issues/258

a workaround this, is to make use of the startDrawingMode method

so you can create your own color picker or use the tui color picker and then invoke the StartDrawingMode method using your own function, here is how I do it in Vue (Nuxt.js)

<MyColorPicker @colorPicked="startDrawing" />

<tui-image-editor ref="imageEditor">
</tui-image-editor>

startDrawing({ color, drawStyle, size }) {
      this.$refs.imageEditor.invoke('stopDrawingMode')
      this.$refs.imageEditor.invoke('startDrawingMode', drawStyle, {
        width: size,
        color,
      })
    }

drawStyle can be 'FREE_DRAWING' or 'LINE_DRAWING'

this code is in Vue (Nuxt.js) but I believe it is fairly similar it React

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda