MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrAnnotationColors.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2026 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef lgrAnnotationColors_H_
10 #define lgrAnnotationColors_H_
11 
12 #include <lgrAnnotations/lgrAnn.h>
13 
14 #include <QColor>
15 #include <QList>
16 #include <QString>
17 
18 namespace MAKLogger
19 {
21  const char* const kLgrSettingsOrganization = "MAK";
22  const char* const kLgrSettingsApplication = "MAK Data Logger";
24  const char* const kLgrAnnotationPresetGroup = "annotationPresets";
25 
28  {
29  public:
31  struct Preset
32  {
33  int slot = 0;
34  QString name;
35  QColor color;
36  bool customized = false;
37  };
38 
40  static QString toHex(const QColor& color);
41 
43  static QColor fromHex(const QString& hex);
44 
47  static QList<Preset> presets();
48 
50  static QColor defaultPresetColor(int slot);
51 
54  static bool isPresetCustomized(int slot);
55 
57  static bool anyPresetCustomized();
58 
62  static bool setPresetColor(int slot,const QColor& color);
63 
66  static bool resetPreset(int slot);
67 
70  static bool resetAllPresets();
71 
74  static QString displayName(const QColor& color);
75 
77  static QString displayName(const QColor& color,const QList<Preset>& presets);
78 
81  static QString describe(const QColor& color);
82 
84  static QString describe(const QColor& color,const QList<Preset>& presets);
85 
87  static qreal relativeLuminance(const QColor& color);
88 
90  static qreal contrastRatio(const QColor& first,const QColor& second);
91 
94  static QColor inkFor(const QColor& background);
95  };
96 }
97 
98 #endif
QString name
Definition: lgrAnnotationColors.h:34
A preset color in slot (1 to 8); name is the hex when the user customized the slot.
Definition: lgrAnnotationColors.h:31
Defines INPORT/EXPORT macros for lgrGui library.
const char *const kLgrSettingsApplication
Definition: lgrAnnotationColors.h:22
User-selectable annotation colors and their #RRGGBB file format.
Definition: lgrAnnotationColors.h:27
QColor color
Definition: lgrAnnotationColors.h:35
const char *const kLgrAnnotationPresetGroup
QSettings group of the preset overrides, one &quot;&lt;group&gt;/&lt;slot&gt;&quot; key per slot.
Definition: lgrAnnotationColors.h:24
const char *const kLgrSettingsOrganization
QSettings organization and application of the logger&#39;s per-user settings (as &quot;mak-theme&quot;).
Definition: lgrAnnotationColors.h:21
#define DT_DLL_LGRANN
Definition: lgrAnn.h:19

Document ID: Generated on Tue Nov 17 15:25:07 EST 2026 from SVN revision 298446
Copyright © 2026 MAK Technologies. All Rights Reserved (www.mak.com)