Taking a quick look at the source code for LinePlot, this is not a capability of the library. You would need to add an on_color event to LinePlot and update the color.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/8bee019a-08d6-4c07-9c19-8521145d91f3n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/61a64f90.1c69fb81.fda20.a944SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
Yes, I am suggesting modifying the source code. Another user made a good suggestion, derive a new class from LinePlot and see if you can make the modifications in the child class.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/486dab9f-dc3e-4ae0-9bc4-80675a9016bfn%40googlegroups.com.
Looking at the source code for LinePlot(),
The method, create_drawings, creates a RenderContext, and sets the color and the Line.
I have not used a RenderContext and am not familiar with the underlying OpenGL technology – but this is what I would try:
Create a new class derived from LinePlot.
In your on_color handler, you will need to run the code from create_drawnings. (super().create_drawings()) Perhaps you will need to clear the render context prior. A quick search of the docs – I did not see a way to clear the render context. I don’t understand the relationship between the canvas and the render context. Do some experiments start by changing the color from black to white and white to black.
Try using the self._grc.clear() method on the render context, the way in works on a canvas.
Clear the render context then create a new one with the new color.
Good Luck!
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/f21f163c-f1e9-403f-aa5e-f48519ffb429n%40googlegroups.com.