- made possible to set the colors for Excellon objects too

- added to the possible colors the fundamentals: black and white
- in the project context menu for setting colors added the option to set the transparency and also a default option which revert the color to the default value set in the Preferences
This commit is contained in:
Marius Stanciu
2020-01-19 19:47:42 +02:00
committed by Marius
parent 4047cc8499
commit 5b63dee50d
5 changed files with 101 additions and 17 deletions

View File

@@ -661,6 +661,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
self.fill_color = self.app.defaults['gerber_plot_fill']
self.outline_color = self.app.defaults['gerber_plot_line']
self.alpha_level = 'bf'
# keep track if the UI is built so we don't have to build it every time
self.ui_build = False
@@ -671,7 +672,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
# Attributes to be included in serialization
# Always append to it because it carries contents
# from predecessors.
self.ser_attrs += ['options', 'kind', 'fill_color', 'outline_color']
self.ser_attrs += ['options', 'kind', 'fill_color', 'outline_color', 'alpha_level']
def set_ui(self, ui):
"""
@@ -2297,10 +2298,14 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
self.multigeo = False
self.units_found = self.app.defaults['units']
self.fill_color = self.app.defaults['excellon_plot_fill']
self.outline_color = self.app.defaults['excellon_plot_line']
self.alpha_level = 'bf'
# Attributes to be included in serialization
# Always append to it because it carries contents
# from predecessors.
self.ser_attrs += ['options', 'kind']
self.ser_attrs += ['options', 'kind',]
def merge(self, exc_list, exc_final):
"""
@@ -3753,6 +3758,10 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
# save here the old value for the Cut Z before it is changed by selecting a V-shape type tool in the tool table
self.old_cutz = self.app.defaults["geometry_cutz"]
self.fill_color = self.app.defaults['geometry_plot_line']
self.outline_color = self.app.defaults['geometry_plot_line']
self.alpha_level = 'FF'
# Attributes to be included in serialization
# Always append to it because it carries contents
# from predecessors.