Vuo  2.1.2
VuoRendererColors.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "VuoNode.hh"
13 #include "VuoRendererItem.hh"
14 
19 {
20 public:
25  {
30  };
31 
36  {
37  directSelection,
38  indirectSelection,
39  noSelection
40  };
41 
42  static VuoRendererColors *getSharedColors(void);
43  VuoRendererColors(VuoNode::TintColor tintColor = VuoNode::TintNone,
44  VuoRendererColors::SelectionType selectionType = VuoRendererColors::noSelection,
45  bool isHovered = false,
47  qint64 timeOfLastActivity = VuoRendererItem::notTrackingActivity,
48  bool isMissingImplementation = false);
49  static void setDark(bool isDark);
50  static bool isDark(void);
51 
52  QColor canvasFill(void);
53 
54  QColor nodeFill(void);
55  QColor nodeFrame(void);
56  QColor nodeTitle(void);
57  QColor nodeClass(void);
58 
59  QColor constantFill(void);
60  QColor constantText(void);
61 
62  QColor animatedPortFill(void);
63  QColor eventBlockingBarrier(void);
64  QColor animatedeventBlockingBarrier(void);
65  QColor actionIndicator(void);
66 
67  QColor publishedPortFill(void);
68  QColor publishedPortTitle(void);
69  QColor publishedProtocolPortTitle(void);
70 
71  QColor portFill(void);
72  QColor portTitlebarFill(void);
73  QColor portTitle(void);
74  QColor portIcon(void);
75 
76  QColor cableMain(void);
77 
78  QColor errorMark(void);
79 
80  QColor commentFrame(void);
81  QColor commentFill(void);
82  QColor commentText(void);
83 
84  QColor selection(void);
85 
86  static qint64 getVirtualNodeExecutionOrigin(void);
87  static qint64 getVirtualFiredEventOrigin(void);
88  static qint64 getVirtualFiredEventOriginForAnimationFadePercentage(qreal percentage);
89  static qint64 getVirtualPropagatedEventOrigin(void);
90 
91  static VuoNode::TintColor getActiveProtocolTint(int protocolIndex, bool isInput);
92 
93  static const int activityAnimationFadeDuration;
94 
95 private:
96  static VuoRendererColors *sharedColors;
97 
98  VuoNode::TintColor tintColor;
100  bool isHovered;
101  bool isMissingImplementation;
102  VuoRendererColors::HighlightType highlightType;
103  double currentFadePercentage;
104  static bool _isDark;
105 
106  QColor baseColor(bool useTintColor = true);
107  QColor applyHighlighting(QColor baseColor, qreal selectionIntensity = .66);
108 
109  QColor lerpColor(QColor v0, QColor v1, float t);
110 
111  qreal getCurrentAlpha(void);
112 
113  static qreal getNodeFillLightness(void);
114 
115  // 'Show Events' mode node alpha levels (range: 0.0-1.0)
116  static const qreal minAlpha;
117  static const int subtleHighlightingLighteningFactor;
118  static const int activityFadeDuration;
119 };
120