@mlightcad/common
Version:
The common package provides shared utilities and base classes that are used across the RealDWG-Web ecosystem. This package contains fundamental components for color management, event handling, logging, performance monitoring, and file loading operations.
54 lines • 3.22 kB
JavaScript
/**
* AutoCad files sometimes use an indexed color value between 1 and 255 inclusive.
* Each value corresponds to a color. index 1 is red, that is 16711680 or 0xFF0000.
* index 0 and 256, while included in this array, are actually reserved for inheritance
* values in AutoCad so they should not be used for index color lookups.
*/
var AUTO_CAD_COLOR_INDEX = [
0, 16711680, 16776960, 65280, 65535, 255, 16711935, 16777215, 8421504,
12632256, 16711680, 16744319, 13369344, 13395558, 10027008, 10046540, 8323072,
8339263, 4980736, 4990502, 16727808, 16752511, 13382400, 13401958, 10036736,
10051404, 8331008, 8343359, 4985600, 4992806, 16744192, 16760703, 13395456,
13408614, 10046464, 10056268, 8339200, 8347455, 4990464, 4995366, 16760576,
16768895, 13408512, 13415014, 10056192, 10061132, 8347392, 8351551, 4995328,
4997670, 16776960, 16777087, 13421568, 13421670, 10000384, 10000460, 8355584,
8355647, 5000192, 5000230, 12582656, 14679935, 10079232, 11717734, 7510016,
8755276, 6258432, 7307071, 3755008, 4344870, 8388352, 12582783, 6736896,
10079334, 5019648, 7510092, 4161280, 6258495, 2509824, 3755046, 4194048,
10485631, 3394560, 8375398, 2529280, 6264908, 2064128, 5209919, 1264640,
3099686, 65280, 8388479, 52224, 6736998, 38912, 5019724, 32512, 4161343,
19456, 2509862, 65343, 8388511, 52275, 6737023, 38950, 5019743, 32543,
4161359, 19475, 2509871, 65407, 8388543, 52326, 6737049, 38988, 5019762,
32575, 4161375, 19494, 2509881, 65471, 8388575, 52377, 6737074, 39026,
5019781, 32607, 4161391, 19513, 2509890, 65535, 8388607, 52428, 6737100,
39064, 5019800, 32639, 4161407, 19532, 2509900, 49151, 8380415, 39372,
6730444, 29336, 5014936, 24447, 4157311, 14668, 2507340, 32767, 8372223,
26316, 6724044, 19608, 5010072, 16255, 4153215, 9804, 2505036, 16383, 8364031,
13260, 6717388, 9880, 5005208, 8063, 4149119, 4940, 2502476, 255, 8355839,
204, 6710988, 152, 5000344, 127, 4145023, 76, 2500172, 4129023, 10452991,
3342540, 8349388, 2490520, 6245528, 2031743, 5193599, 1245260, 3089996,
8323327, 12550143, 6684876, 10053324, 4980888, 7490712, 4128895, 6242175,
2490444, 3745356, 12517631, 14647295, 10027212, 11691724, 7471256, 8735896,
6226047, 7290751, 3735628, 4335180, 16711935, 16744447, 13369548, 13395660,
9961624, 9981080, 8323199, 8339327, 4980812, 4990540, 16711871, 16744415,
13369497, 13395634, 9961586, 9981061, 8323167, 8339311, 4980793, 4990530,
16711807, 16744383, 13369446, 13395609, 9961548, 9981042, 8323135, 8339295,
4980774, 4990521, 16711743, 16744351, 13369395, 13395583, 9961510, 9981023,
8323103, 8339279, 4980755, 4990511, 3355443, 5987163, 8684676, 11382189,
14079702, 16777215
];
var AcCmColorUtil = /** @class */ (function () {
function AcCmColorUtil() {
}
/**
* Return the truecolor value of the given AutoCAD color index value
* @param index Input AutoCAD color index value
* @return Return truecolor value as a number
*/
AcCmColorUtil.getAcadColor = function (index) {
return AUTO_CAD_COLOR_INDEX[index];
};
return AcCmColorUtil;
}());
export { AcCmColorUtil };
//# sourceMappingURL=AcCmColorUtil.js.map