gcodegraphics set_plot_colors

More
16 Oct 2021 23:31 #223341 by cmorley

preference file/tool table, that would be slick.
Here is my crude axis implementation
def backplot():
     
     # tool 1 = #Red (255,0,0)
      if s.tool_in_spindle == 1:
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (255,0,0,255),
                                    (255,0,0,255),
                                    (255,255,255,255),
                                    (0,255,255,255))
      #tool 2 = #Lime (0,255,0)
      elif s.tool_in_spindle == 2:
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (0,255,0,255),
                                    (0,255,0,255),
                                    (255,255,255,255),
                                    (0,255,255,255))
                                    
                                    
      #tool 8 = #Blue (0,0,255)
      elif s.tool_in_spindle == 8:
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (0,0,255,255),
                                    (0,0,255,255),
                                    (255,255,255,255),
                                    (0,255,255,255))                             
       #tool 22 = #Yellow (255,255,0)
      elif s.tool_in_spindle == 22:
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (255,255,0,255),
                                    (255,255,0,255),
                                    (255,255,255,255),
                                    (0,255,255,255))  
       #tool 24 = #Cyan (0,255,255)
      elif s.tool_in_spindle == 24:
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (0,255,255,255),
                                    (0,255,255,255),
                                    (255,255,255,255),
                                    (0,255,255,255))                               
                                    
                                    
       #tool 7 = #Magenta / (255,0,255)
      elif s.tool_in_spindle == 7:
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (255,0,255,255),
                                    (255,0,255,255),
                                    (255,255,255,255),
                                    (0,255,255,255))                               
       #tool 18 = #Maroon (128,0,0)
      elif s.tool_in_spindle == 18:
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (128,0,0,255),
                                    (128,0,0,255),
                                    (255,255,255,255),
                                    (0,255,255,255))                               
        
           #tool 3 = #Olive (128,128,0)
      elif s.tool_in_spindle == 3:
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (128,128,0,255),
                                    (128,128,0,255),
                                    (255,255,255,255),
                                    (0,255,255,255))                               
                                                                 
                                    
      else: 
            live_plotter.logger.set_colors((255,0,0,255),
                                    (0,255,0,255),
                                    (0,255,0,255),
                                    (0,255,0,255),
                                    (255,255,255,255),
                                    (0,255,255,255))
      
 


There is also
live_plotter.
logger.get_colors (for AXIS) to get all the currently used colors. Useful if you only want to change one color.

 
The following user(s) said Thank You: cakeslob, snowgoer540

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.209 seconds
Powered by Kunena Forum