From 3caf194ddd90073feb069c76ee3bb186be343326 Mon Sep 17 00:00:00 2001 From: Tobias Richter Date: Fri, 10 Feb 2023 13:57:31 +0100 Subject: [PATCH] simplify colour defintion and make consistent --- nexus_constructor/instrument_view/axis_colors.py | 9 --------- nexus_constructor/instrument_view/gnomon.py | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 nexus_constructor/instrument_view/axis_colors.py diff --git a/nexus_constructor/instrument_view/axis_colors.py b/nexus_constructor/instrument_view/axis_colors.py deleted file mode 100644 index 32a3d4159..000000000 --- a/nexus_constructor/instrument_view/axis_colors.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - -from PySide6.QtGui import QColor - - -class AxisColors(Enum): - X = QColor(255, 0, 0) - Y = QColor(0, 255, 0) - Z = QColor(0, 0, 255) diff --git a/nexus_constructor/instrument_view/gnomon.py b/nexus_constructor/instrument_view/gnomon.py index ed61c2ae8..42db454ae 100644 --- a/nexus_constructor/instrument_view/gnomon.py +++ b/nexus_constructor/instrument_view/gnomon.py @@ -4,7 +4,6 @@ from PySide6.QtCore import QPropertyAnimation from PySide6.QtGui import QColor, QFont, QMatrix4x4, QVector3D, QVector4D -from nexus_constructor.instrument_view.axis_colors import AxisColors from nexus_constructor.instrument_view.neutron_animation_controller import ( NeutronAnimationController, ) @@ -174,10 +173,9 @@ def create_gnomon_text(self): x_axis_text = Qt3DExtras.QText2DEntity(self.gnomon_root_entity) y_axis_text = Qt3DExtras.QText2DEntity(self.gnomon_root_entity) z_axis_text = Qt3DExtras.QText2DEntity(self.gnomon_root_entity) - self.set_axis_label_text(x_axis_text, "X", AxisColors.X.value) - # Pass "green" rather than the Y axis enum value because otherwise the text is too bright + self.set_axis_label_text(x_axis_text, "X", QColor("red")) self.set_axis_label_text(y_axis_text, "Y", QColor("green")) - self.set_axis_label_text(z_axis_text, "Z", AxisColors.Z.value) + self.set_axis_label_text(z_axis_text, "Z", QColor("blue")) ( x_label_matrix, y_label_matrix,