H
H
hollanditkzn2017-03-15 12:23:56
JavaScript
hollanditkzn, 2017-03-15 12:23:56

How to get data and change color?

Can't get data and display the color being selected. Here is the code

<input type="text" id="colorTextKons" name="colorTextKons" class="jscolor">

And in javascript
$("#colorTextKons").on("input", function(){
    var color = $(this).val();
    ctx.fillStyle = "#"+ color;
  });

I didn’t write all the canvas code, if you do input type=color, then everything works, if you use this plugin, then the text is not repainted. I use jscolor.com/examples
plugin

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2017-03-15
@bingo347

you also need to redraw those parts for which you change the color,
changing the context styles only affects further rendering

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question