提交 bac03f07 编写于 作者: K Kentaro Wada

Config for shape colors (line_color, fill_color, etc)

上级 c3809e8f
......@@ -73,6 +73,22 @@ class MainWindow(QtWidgets.QMainWindow):
config = get_config()
self._config = config
# set default shape colors
Shape.line_color = QtGui.QColor(*self._config["shape"]["line_color"])
Shape.fill_color = QtGui.QColor(*self._config["shape"]["fill_color"])
Shape.select_line_color = QtGui.QColor(
*self._config["shape"]["select_line_color"]
)
Shape.select_fill_color = QtGui.QColor(
*self._config["shape"]["select_fill_color"]
)
Shape.vertex_fill_color = QtGui.QColor(
*self._config["shape"]["vertex_fill_color"]
)
Shape.hvertex_fill_color = QtGui.QColor(
*self._config["shape"]["hvertex_fill_color"]
)
super(MainWindow, self).__init__()
self.setWindowTitle(__appname__)
......@@ -1099,8 +1115,6 @@ class MainWindow(QtWidgets.QMainWindow):
action.setEnabled(True)
rgb = self._get_rgb_by_label(shape.label)
if rgb is None:
return
r, g, b = rgb
label_list_item.setText(
......
......@@ -14,11 +14,21 @@ file_search: null
sort_labels: true
validate_label: null
default_shape_color: null
shape_color: auto # null, 'auto', 'manual'
default_shape_color: [0, 255, 0]
shape_color: auto # null, 'auto', 'manual'
shift_auto_shape_color: 0
label_colors: null
shape:
# drawing
line_color: [0, 255, 0, 128]
fill_color: [0, 255, 0, 64]
vertex_fill_color: [0, 255, 0, 255]
# selecting / hovering
select_line_color: [255, 255, 255, 255]
select_fill_color: [0, 255, 0, 155]
hvertex_fill_color: [255, 255, 255, 255]
# main
flag_dock:
show: true
......
......@@ -11,12 +11,11 @@ import labelme.utils
# - [opt] Store paths instead of creating new ones at each paint.
R, G, B = SHAPE_COLOR = 0, 255, 0 # green
DEFAULT_LINE_COLOR = QtGui.QColor(R, G, B, 128) # bf hovering
DEFAULT_FILL_COLOR = QtGui.QColor(R, G, B, 128) # hovering
DEFAULT_LINE_COLOR = QtGui.QColor(0, 255, 0, 128) # bf hovering
DEFAULT_FILL_COLOR = QtGui.QColor(0, 255, 0, 128) # hovering
DEFAULT_SELECT_LINE_COLOR = QtGui.QColor(255, 255, 255) # selected
DEFAULT_SELECT_FILL_COLOR = QtGui.QColor(R, G, B, 155) # selected
DEFAULT_VERTEX_FILL_COLOR = QtGui.QColor(R, G, B, 255) # hovering
DEFAULT_SELECT_FILL_COLOR = QtGui.QColor(0, 255, 0, 155) # selected
DEFAULT_VERTEX_FILL_COLOR = QtGui.QColor(0, 255, 0, 255) # hovering
DEFAULT_HVERTEX_FILL_COLOR = QtGui.QColor(255, 255, 255, 255) # hovering
......
......@@ -565,7 +565,6 @@ class Canvas(QtWidgets.QWidget):
drawing_shape = self.current.copy()
drawing_shape.addPoint(self.line[1])
drawing_shape.fill = True
drawing_shape.fill_color.setAlpha(64)
drawing_shape.paint(p)
p.end()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册