Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / tools / colordata.hxx
blob3df26b57092b3bf6b235d211d288709ba16d9151
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_TOOLS_COLORDATA_HXX
20 #define INCLUDED_TOOLS_COLORDATA_HXX
22 #include <sal/types.h>
24 // Color types
25 typedef sal_uInt32 ColorData;
27 constexpr ColorData TRGB_COLORDATA(
28 sal_uInt8 TRANSPARENCE, sal_uInt8 RED, sal_uInt8 GREEN, sal_uInt8 BLUE)
30 return sal_uInt32(BLUE) | (sal_uInt32(GREEN) << 8) | (sal_uInt32(RED) << 16)
31 | (sal_uInt32(TRANSPARENCE) << 24);
34 constexpr ColorData RGB_COLORDATA(sal_uInt8 r, sal_uInt8 g, sal_uInt8 b) {
35 return sal_uInt32(b) | (sal_uInt32(g) << 8) | (sal_uInt32(r) << 16);
38 #define COLORDATA_RED( n ) ((sal_uInt8)((n)>>16))
39 #define COLORDATA_GREEN( n ) ((sal_uInt8)(((sal_uInt16)(n)) >> 8))
40 #define COLORDATA_BLUE( n ) ((sal_uInt8)(n))
41 #define COLORDATA_TRANSPARENCY( n ) ((sal_uInt8)((n)>>24))
42 #define COLORDATA_RGB( n ) ((ColorData)((n) & 0x00FFFFFF))
44 #define COL_BLACK RGB_COLORDATA( 0x00, 0x00, 0x00 )
45 #define COL_BLUE RGB_COLORDATA( 0x00, 0x00, 0x80 )
46 #define COL_GREEN RGB_COLORDATA( 0x00, 0x80, 0x00 )
47 #define COL_CYAN RGB_COLORDATA( 0x00, 0x80, 0x80 )
48 #define COL_RED RGB_COLORDATA( 0x80, 0x00, 0x00 )
49 #define COL_RED_FONTCOLOR RGB_COLORDATA( 0xCE, 0x18, 0x1E )
50 #define COL_MAGENTA RGB_COLORDATA( 0x80, 0x00, 0x80 )
51 #define COL_BROWN RGB_COLORDATA( 0x80, 0x80, 0x00 )
52 #define COL_GRAY RGB_COLORDATA( 0x80, 0x80, 0x80 )
53 #define COL_GRAY3 RGB_COLORDATA( 0xCC, 0xCC, 0xCC )
54 #define COL_GRAY7 RGB_COLORDATA( 0x66, 0x66, 0x66 )
55 #define COL_LIGHTGRAY RGB_COLORDATA( 0xC0, 0xC0, 0xC0 )
56 #define COL_LIGHTBLUE RGB_COLORDATA( 0x00, 0x00, 0xFF )
57 #define COL_LIGHTGREEN RGB_COLORDATA( 0x00, 0xFF, 0x00 )
58 #define COL_LIGHTCYAN RGB_COLORDATA( 0x00, 0xFF, 0xFF )
59 #define COL_LIGHTRED RGB_COLORDATA( 0xFF, 0x00, 0x00 )
60 #define COL_LIGHTMAGENTA RGB_COLORDATA( 0xFF, 0x00, 0xFF )
61 #define COL_LIGHTGRAYBLUE RGB_COLORDATA( 0xE0, 0xE0, 0xFF )
62 #define COL_YELLOW RGB_COLORDATA( 0xFF, 0xFF, 0x00 )
63 #define COL_YELLOW_HIGHLIGHT RGB_COLORDATA( 0xFF, 0xF2, 0x00 )
64 #define COL_WHITE RGB_COLORDATA( 0xFF, 0xFF, 0xFF )
65 #define COL_TRANSPARENT TRGB_COLORDATA( 0xFF, 0xFF, 0xFF, 0xFF )
66 #define COL_AUTO (ColorData)0xFFFFFFFF
67 #define COL_AUTHOR1_DARK RGB_COLORDATA(198, 146, 0)
68 #define COL_AUTHOR1_NORMAL RGB_COLORDATA(255, 255, 158)
69 #define COL_AUTHOR1_LIGHT RGB_COLORDATA(255, 255, 195)
70 #define COL_AUTHOR2_DARK RGB_COLORDATA(6, 70, 162)
71 #define COL_AUTHOR2_NORMAL RGB_COLORDATA(216, 232, 255)
72 #define COL_AUTHOR2_LIGHT RGB_COLORDATA(233, 242, 255)
73 #define COL_AUTHOR3_DARK RGB_COLORDATA(87, 157, 28)
74 #define COL_AUTHOR3_NORMAL RGB_COLORDATA(218, 248, 193)
75 #define COL_AUTHOR3_LIGHT RGB_COLORDATA(226, 250, 207)
76 #define COL_AUTHOR4_DARK RGB_COLORDATA(105, 43, 157)
77 #define COL_AUTHOR4_NORMAL RGB_COLORDATA(228, 210, 245)
78 #define COL_AUTHOR4_LIGHT RGB_COLORDATA(239, 228, 248)
79 #define COL_AUTHOR5_DARK RGB_COLORDATA(197, 0, 11)
80 #define COL_AUTHOR5_NORMAL RGB_COLORDATA(254, 205, 208)
81 #define COL_AUTHOR5_LIGHT RGB_COLORDATA(255, 227, 229)
82 #define COL_AUTHOR6_DARK RGB_COLORDATA(0, 128, 128)
83 #define COL_AUTHOR6_NORMAL RGB_COLORDATA(210, 246, 246)
84 #define COL_AUTHOR6_LIGHT RGB_COLORDATA(230, 250, 250)
85 #define COL_AUTHOR7_DARK RGB_COLORDATA(140, 132, 0)
86 #define COL_AUTHOR7_NORMAL RGB_COLORDATA(237, 252, 163)
87 #define COL_AUTHOR7_LIGHT RGB_COLORDATA(242, 254, 181)
88 #define COL_AUTHOR8_DARK RGB_COLORDATA(53, 85, 107)
89 #define COL_AUTHOR8_NORMAL RGB_COLORDATA(211, 222, 232)
90 #define COL_AUTHOR8_LIGHT RGB_COLORDATA(226, 234, 241)
91 #define COL_AUTHOR9_DARK RGB_COLORDATA(209, 118, 0)
92 #define COL_AUTHOR9_NORMAL RGB_COLORDATA(255, 226, 185)
93 #define COL_AUTHOR9_LIGHT RGB_COLORDATA(255, 231, 199)
95 #define COLOR_CHANNEL_MERGE( _def_cDst, _def_cSrc, _def_cSrcTrans ) \
96 ((sal_uInt8)((((long)(_def_cDst)-(_def_cSrc))*(_def_cSrcTrans)+(((_def_cSrc)<<8L)|(_def_cDst)))>>8L))
98 #endif
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */