ColorUtil.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
11 #include "DgnPlatform.h"
12 
13 BENTLEY_TYPEDEFS (RgbColorDef)
14 
16 
18 {
23  MAX_ExtendedColorIndex = 0x0fffff, // Use 20 bits of high 24.
24 
25  // Menu Color Indexes
37 
38  NUM_MENU_COLORS = 12, // number of menu colors
41 
42  // Method Ids for setting and querying color descriptors
43  COLORD_RGB = 1, // S/Q
44  COLORD_HSV = 2, // S/Q
45  COLORD_XCOLORID = 3, // S/Q
47  COLORD_XCOLORSTRING = 4, // S/Q
50  COLORD_MENUCOLORID = 6, // S/Q
51  COLORD_ATTRDATA = 7, // BSI-only
52  COLORD_RGBDITHERED = 8, // BSI-only
53  COLORD_VPAL_INDEX = 9, // Q-only
54  COLORD_ELEM_COLOR_REF = 10, // S-only
55  COLORD_DRAW_VALUE = 20, // S/Q
57 
58  // Bit flags for "asetFlags" member of palette entry.
61 
62  // Palette Status flags
64 
65  // Color matching flags
70 
71  // Palette Synch flags
74 };
75 
76 
77 //=======================================================================================
80 //=======================================================================================
82 {
86 
87  void SetColors (Byte r, Byte g, Byte b, Byte a) {m_rgba.red = r; m_rgba.green = g; m_rgba.blue = b; m_rgba.alpha = a;}
88 
89  IntColorDef () {m_int = 0;}
90  IntColorDef (RgbColorDef rgb) {m_int = 0; m_rgb = rgb;}
91  IntColorDef (UInt32 intval) {m_int=intval;}
92  IntColorDef (Byte red, Byte green, Byte blue) {SetColors (red,green,blue,0);}
93  IntColorDef (Byte red, Byte green, Byte blue, Byte alpha) {SetColors (red,green,blue,alpha);}
94 };
95 
96 
98 
Definition: ColorUtil.h:38
IntColorDef(UInt32 intval)
Definition: ColorUtil.h:91
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
Definition: ColorUtil.h:20
IntColorDef(Byte red, Byte green, Byte blue, Byte alpha)
Definition: ColorUtil.h:93
IntColorDef(Byte red, Byte green, Byte blue)
Definition: ColorUtil.h:92
Definition: ColorUtil.h:48
ColorDefConstants
Definition: ColorUtil.h:17
Definition: ColorUtil.h:67
uint32_t UInt32
Definition: Bentley.r.h:128
IntColorDef()
Definition: ColorUtil.h:89
Definition: ColorUtil.h:51
IntColorDef(RgbColorDef rgb)
Definition: ColorUtil.h:90
Definition: ColorUtil.h:44
void SetColors(Byte r, Byte g, Byte b, Byte a)
Definition: ColorUtil.h:87
Definition: ColorUtil.h:56
Union that allows a color to be accessed as a UInt32 (in form TBGR), RgbColorDef, or RgbaColorDef...
Definition: ColorUtil.h:81
#define BENTLEY_TYPEDEFS(_name_)
Definition: Bentley.h:152
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
Definition: ColorUtil.h:45
Definition: ColorUtil.h:43
Definition: ColorUtil.h:21
RgbColorDef m_rgb
Definition: ColorUtil.h:83
unsigned char Byte
Definition: Bentley.r.h:143
RgbaColorDef m_rgba
Definition: ColorUtil.h:84
Definition: ColorUtil.h:53
UInt32 m_int
Definition: ColorUtil.h:85
Definition: DgnPlatform.r.h:339
Definition: ColorUtil.h:55
Definition: ColorUtil.h:46
Definition: DgnPlatform.r.h:331
Definition: ColorUtil.h:22

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.