LibreOffice Module tools (master) 1
color.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_TOOLS_COLOR_HXX
20#define INCLUDED_TOOLS_COLOR_HXX
21
22#include <sal/types.h>
23#include <tools/toolsdllapi.h>
24#include <com/sun/star/uno/Any.hxx>
25#include <config_global.h>
27#include <osl/endian.h>
28
29namespace color
30{
31
32constexpr sal_uInt32 extractRGB(sal_uInt32 nColorNumber)
33{
34 return nColorNumber & 0x00FFFFFF;
35}
36
38{
39 return sal_uInt8(((sal_Int32(nDst) - nSrc) * nSrcTrans + ((nSrc << 8) | nDst)) >> 8);
40}
41
42}
43
47
48// Color
49
51{
52 union
53 {
54 sal_uInt32 mValue;
55 struct
56 {
57#ifdef OSL_BIGENDIAN
58 sal_uInt8 T;
62#else
67#endif
68 };
69 };
70
71public:
72 constexpr Color()
73 : mValue(0) // black
74 {}
75
76#if HAVE_CPP_CONSTEVAL
77 consteval
78#else
79 constexpr
80#endif
81 Color(const sal_uInt32 nColor)
82 : mValue(nColor)
83 {
84 assert(nColor <= 0xffffff && "don't pass transparency to this constructor, use the Color(ColorTransparencyTag,...) or Color(ColorAlphaTag,...) constructor to make it explicit");
85 }
86
87 constexpr Color(enum ColorTransparencyTag, sal_uInt32 nColor)
88 : mValue(nColor)
89 {
90 }
91
92 constexpr Color(enum ColorAlphaTag, sal_uInt32 nColor)
93 : mValue((nColor & 0xffffff) | ((255 - (nColor >> 24)) << 24))
94 {
95 }
96
97 constexpr Color(enum ColorTransparencyTag, sal_uInt8 nTransparency, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
98 : mValue(sal_uInt32(nBlue) | (sal_uInt32(nGreen) << 8) | (sal_uInt32(nRed) << 16) | (sal_uInt32(nTransparency) << 24))
99 {}
100
101 constexpr Color(enum ColorAlphaTag, sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
102 : Color(ColorTransparency, 255 - nAlpha, nRed, nGreen, nBlue)
103 {}
104
105 constexpr Color(sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
106 : Color(ColorTransparency, 0, nRed, nGreen, nBlue)
107 {}
108
109 // constructor to create a tools-Color from ::basegfx::BColor
110 explicit Color(const basegfx::BColor& rBColor)
112 sal_uInt8(std::lround(rBColor.getRed() * 255.0)),
113 sal_uInt8(std::lround(rBColor.getGreen() * 255.0)),
114 sal_uInt8(std::lround(rBColor.getBlue() * 255.0)))
115 {}
116
121 constexpr explicit operator sal_uInt32() const
122 {
123 return mValue;
124 }
125
130 constexpr explicit operator sal_Int32() const
131 {
132 return sal_Int32(mValue);
133 }
134
135 /* Basic RGBA operations */
136
141 {
142 return R;
143 }
144
149 {
150 return G;
151 }
152
157 {
158 return B;
159 }
160
165 {
166 return 255 - T;
167 }
168
171 bool IsTransparent() const
172 {
173 return GetAlpha() != 255;
174 }
175
179 {
180 return T == 255;
181 }
182
186 void SetRed(sal_uInt8 nRed)
187 {
188 R = nRed;
189 }
190
194 void SetGreen(sal_uInt8 nGreen)
195 {
196 G = nGreen;
197 }
198
202 void SetBlue(sal_uInt8 nBlue)
203 {
204 B = nBlue;
205 }
206
210 void SetAlpha(sal_uInt8 nAlpha)
211 {
212 T = 255 - nAlpha;
213 }
214
219 {
220 return {R, G, B};
221 }
222
223 /* Comparison and operators */
224
229 bool IsRGBEqual( const Color& rColor ) const
230 {
231 return ( mValue & 0x00FFFFFF ) == ( rColor.mValue & 0x00FFFFFF );
232 }
233
238 bool operator<(const Color& aCompareColor) const
239 {
240 return mValue < aCompareColor.mValue;
241 }
242
247 bool operator>(const Color& aCompareColor) const
248 {
249 return mValue > aCompareColor.mValue;
250 }
251
256 bool operator==(const Color& rColor) const
257 {
258 return mValue == rColor.mValue;
259 }
260
265 bool operator!=(const Color& rColor) const
266 {
267 return mValue != rColor.mValue;
268 }
269
276 sal_uInt16 GetColorError(const Color& rCompareColor) const
277 {
278 return static_cast<sal_uInt16>(
279 abs(static_cast<int>(GetBlue()) - rCompareColor.GetBlue()) +
280 abs(static_cast<int>(GetGreen()) - rCompareColor.GetGreen()) +
281 abs(static_cast<int>(GetRed()) - rCompareColor.GetRed()));
282 }
283
284 /* Light and contrast */
285
290 {
291 return sal_uInt8((B * 29UL + G * 151UL + R * 76UL) >> 8);
292 }
293
297 void IncreaseLuminance(sal_uInt8 cLumInc);
298
302 void DecreaseLuminance(sal_uInt8 cLumDec);
303
307 void DecreaseContrast(sal_uInt8 cContDec);
308
312 bool IsDark() const
313 {
314 // tdf#156182
315 return GetLuminance() <= 156;
316 }
317
321 bool IsBright() const
322 {
323 return GetLuminance() >= 245;
324 }
325
326 /* Color filters */
327
336 void ApplyTintOrShade(sal_Int16 n100thPercent);
337
344 void ApplyLumModOff(sal_Int16 nMod, sal_Int16 nOff);
345
350 void Invert()
351 {
352 R = ~R;
353 G = ~G;
354 B = ~B;
355 }
356
362 void Merge(const Color& rMergeColor, sal_uInt8 cTransparency)
363 {
364 R = color::ColorChannelMerge(R, rMergeColor.R, cTransparency);
365 G = color::ColorChannelMerge(G, rMergeColor.G, cTransparency);
366 B = color::ColorChannelMerge(B, rMergeColor.B, cTransparency);
367 }
368
369 /* Change of format */
370
381 static Color HSBtoRGB(sal_uInt16 nHue, sal_uInt16 nSaturation, sal_uInt16 nBrightness);
382
394 static Color STRtoRGB(std::u16string_view colorname);
395
401 void RGBtoHSB(sal_uInt16& nHue, sal_uInt16& nSaturation, sal_uInt16& nBrightness) const;
402
403 /* Return color as RGB hex string: rrggbb
404 * for example "00ff00" for green color
405 * @return hex string
406 */
407 OUString AsRGBHexString() const;
408
409 /* Return color as RGB hex string: RRGGBB
410 * for example "00FF00" for green color
411 * @return hex string
412 */
413 OUString AsRGBHEXString() const;
414
415 /* get ::basegfx::BColor from this color
416 * @return basegfx color
417 */
419 {
420 return basegfx::BColor(R / 255.0, G / 255.0, B / 255.0);
421 }
422};
423
424// to reduce the noise when moving these into and out of Any
425inline bool operator >>=( const css::uno::Any & rAny, Color & value )
426{
427 sal_Int32 nTmp = {}; // spurious -Werror=maybe-uninitialized
428 if (!(rAny >>= nTmp))
429 return false;
431 return true;
432}
433
434inline void operator <<=( css::uno::Any & rAny, Color value )
435{
436 rAny <<= sal_Int32(value);
437}
438
439namespace com::sun::star::uno {
440 template<> inline Any::Any(Color const & value): Any(sal_Int32(value)) {}
441}
442
443// Test compile time conversion of Color to sal_uInt32
444
445static_assert (sal_uInt32(Color(ColorTransparency, 0x00, 0x12, 0x34, 0x56)) == 0x00123456);
446static_assert (sal_uInt32(Color(0x12, 0x34, 0x56)) == 0x00123456);
447
448// Color types
449
450inline constexpr ::Color COL_TRANSPARENT ( ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF );
451inline constexpr ::Color COL_AUTO ( ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF );
452// These are used when drawing to the separate alpha channel we use in vcl
453inline constexpr ::Color COL_ALPHA_TRANSPARENT ( 0x00, 0x00, 0x00 );
454inline constexpr ::Color COL_ALPHA_OPAQUE ( 0xff, 0xff, 0xff );
455
456inline constexpr ::Color COL_BLACK ( 0x00, 0x00, 0x00 );
457inline constexpr ::Color COL_BLUE ( 0x00, 0x00, 0x80 );
458inline constexpr ::Color COL_GREEN ( 0x00, 0x80, 0x00 );
459inline constexpr ::Color COL_CYAN ( 0x00, 0x80, 0x80 );
460inline constexpr ::Color COL_RED ( 0x80, 0x00, 0x00 );
461inline constexpr ::Color COL_MAGENTA ( 0x80, 0x00, 0x80 );
462inline constexpr ::Color COL_BROWN ( 0x80, 0x80, 0x00 );
463inline constexpr ::Color COL_GRAY ( 0x80, 0x80, 0x80 );
464inline constexpr ::Color COL_GRAY3 ( 0xCC, 0xCC, 0xCC );
465inline constexpr ::Color COL_GRAY7 ( 0x66, 0x66, 0x66 );
466inline constexpr ::Color COL_LIGHTGRAY ( 0xC0, 0xC0, 0xC0 );
467inline constexpr ::Color COL_LIGHTBLUE ( 0x00, 0x00, 0xFF );
468inline constexpr ::Color COL_LIGHTGREEN ( 0x00, 0xFF, 0x00 );
469inline constexpr ::Color COL_LIGHTCYAN ( 0x00, 0xFF, 0xFF );
470inline constexpr ::Color COL_LIGHTRED ( 0xFF, 0x00, 0x00 );
471inline constexpr ::Color COL_LIGHTMAGENTA ( 0xFF, 0x00, 0xFF );
472inline constexpr ::Color COL_LIGHTGRAYBLUE ( 0xE0, 0xE0, 0xFF );
473inline constexpr ::Color COL_YELLOW ( 0xFF, 0xFF, 0x00 );
474inline constexpr ::Color COL_WHITE ( 0xFF, 0xFF, 0xFF );
475inline constexpr ::Color COL_AUTHOR1_DARK ( 0xC6, 0x92, 0x00 );
476inline constexpr ::Color COL_AUTHOR1_NORMAL ( 0xFF, 0xFF, 0x9E );
477inline constexpr ::Color COL_AUTHOR1_LIGHT ( 0xFF, 0xFF, 0xC3 );
478inline constexpr ::Color COL_AUTHOR2_DARK ( 0x06, 0x46, 0xA2 );
479inline constexpr ::Color COL_AUTHOR2_NORMAL ( 0xD8, 0xE8, 0xFF );
480inline constexpr ::Color COL_AUTHOR2_LIGHT ( 0xE9, 0xF2, 0xFF );
481inline constexpr ::Color COL_AUTHOR3_DARK ( 0x57, 0x9D, 0x1C );
482inline constexpr ::Color COL_AUTHOR3_NORMAL ( 0xDA, 0xF8, 0xC1 );
483inline constexpr ::Color COL_AUTHOR3_LIGHT ( 0xE2, 0xFA, 0xCF );
484inline constexpr ::Color COL_AUTHOR4_DARK ( 0x69, 0x2B, 0x9D );
485inline constexpr ::Color COL_AUTHOR4_NORMAL ( 0xE4, 0xD2, 0xF5 );
486inline constexpr ::Color COL_AUTHOR4_LIGHT ( 0xEF, 0xE4, 0xF8 );
487inline constexpr ::Color COL_AUTHOR5_DARK ( 0xC5, 0x00, 0x0B );
488inline constexpr ::Color COL_AUTHOR5_NORMAL ( 0xFE, 0xCD, 0xD0 );
489inline constexpr ::Color COL_AUTHOR5_LIGHT ( 0xFF, 0xE3, 0xE5 );
490inline constexpr ::Color COL_AUTHOR6_DARK ( 0x00, 0x80, 0x80 );
491inline constexpr ::Color COL_AUTHOR6_NORMAL ( 0xD2, 0xF6, 0xF6 );
492inline constexpr ::Color COL_AUTHOR6_LIGHT ( 0xE6, 0xFA, 0xFA );
493inline constexpr ::Color COL_AUTHOR7_DARK ( 0x8C, 0x84, 0x00 );
494inline constexpr ::Color COL_AUTHOR7_NORMAL ( 0xED, 0xFC, 0xA3 );
495inline constexpr ::Color COL_AUTHOR7_LIGHT ( 0xF2, 0xFE, 0xB5 );
496inline constexpr ::Color COL_AUTHOR8_DARK ( 0x35, 0x55, 0x6B );
497inline constexpr ::Color COL_AUTHOR8_NORMAL ( 0xD3, 0xDE, 0xE8 );
498inline constexpr ::Color COL_AUTHOR8_LIGHT ( 0xE2, 0xEA, 0xF1 );
499inline constexpr ::Color COL_AUTHOR9_DARK ( 0xD1, 0x76, 0x00 );
500inline constexpr ::Color COL_AUTHOR9_NORMAL ( 0xFF, 0xE2, 0xB9 );
501inline constexpr ::Color COL_AUTHOR9_LIGHT ( 0xFF, 0xE7, 0xC7 );
502inline constexpr ::Color COL_AUTHOR_TABLE_INS ( 0xE1, 0xF2, 0xFA );
503inline constexpr ::Color COL_AUTHOR_TABLE_DEL ( 0xFC, 0xE6, 0xF4 );
504
505template<typename charT, typename traits>
506inline std::basic_ostream<charT, traits>& operator <<(std::basic_ostream<charT, traits>& rStream, const Color& rColor)
507{
508 std::ios_base::fmtflags nOrigFlags = rStream.flags();
509 rStream << "rgba[" << std::hex << std::setfill ('0')
510 << std::setw(2) << static_cast<int>(rColor.GetRed())
511 << std::setw(2) << static_cast<int>(rColor.GetGreen())
512 << std::setw(2) << static_cast<int>(rColor.GetBlue())
513 << std::setw(2) << static_cast<int>(rColor.GetAlpha()) << "]";
514 rStream.setf(nOrigFlags);
515 return rStream;
516}
517
518#endif
519
520/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: color.hxx:51
Color GetRGBColor() const
Returns the same color but ignoring the transparency value.
Definition: color.hxx:218
sal_uInt8 GetLuminance() const
Gets the color luminance.
Definition: color.hxx:289
constexpr Color(enum ColorAlphaTag, sal_uInt32 nColor)
Definition: color.hxx:92
bool operator<(const Color &aCompareColor) const
Check if the color value is lower than aCompareColor.
Definition: color.hxx:238
sal_uInt8 GetBlue() const
Gets the blue value.
Definition: color.hxx:156
sal_uInt32 mValue
Definition: color.hxx:54
sal_uInt8 B
Definition: color.hxx:63
sal_uInt8 R
Definition: color.hxx:65
bool IsBright() const
Comparison with luminance thresholds.
Definition: color.hxx:321
bool IsFullyTransparent() const
Is the color fully transparent i.e.
Definition: color.hxx:178
constexpr Color(sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
Definition: color.hxx:105
void SetGreen(sal_uInt8 nGreen)
Sets the green value.
Definition: color.hxx:194
void SetRed(sal_uInt8 nRed)
Sets the red value.
Definition: color.hxx:186
basegfx::BColor getBColor() const
Definition: color.hxx:418
void Merge(const Color &rMergeColor, sal_uInt8 cTransparency)
Merges color with rMergeColor.
Definition: color.hxx:362
bool IsDark() const
Comparison with luminance thresholds.
Definition: color.hxx:312
sal_uInt8 G
Definition: color.hxx:64
bool operator==(const Color &rColor) const
Check if the color value is equal than rColor.
Definition: color.hxx:256
constexpr Color(enum ColorTransparencyTag, sal_uInt32 nColor)
Definition: color.hxx:87
bool operator!=(const Color &rColor) const
Check if the color value is unequal than rColor.
Definition: color.hxx:265
sal_uInt8 GetAlpha() const
Gets the alpha value.
Definition: color.hxx:164
void Invert()
Inverts color.
Definition: color.hxx:350
constexpr Color(const sal_uInt32 nColor)
Definition: color.hxx:81
bool operator>(const Color &aCompareColor) const
Check if the color value is greater than aCompareColor.
Definition: color.hxx:247
constexpr Color(enum ColorAlphaTag, sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
Definition: color.hxx:101
sal_uInt8 GetRed() const
Gets the red value.
Definition: color.hxx:140
bool IsRGBEqual(const Color &rColor) const
Check if the color RGB value is equal than rColor.
Definition: color.hxx:229
sal_uInt16 GetColorError(const Color &rCompareColor) const
Gets the color error compared to another.
Definition: color.hxx:276
constexpr Color(enum ColorTransparencyTag, sal_uInt8 nTransparency, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
Definition: color.hxx:97
bool IsTransparent() const
Is the color transparent?
Definition: color.hxx:171
sal_uInt8 T
Definition: color.hxx:66
sal_uInt8 GetGreen() const
Gets the green value.
Definition: color.hxx:148
void SetAlpha(sal_uInt8 nAlpha)
Sets the alpha value.
Definition: color.hxx:210
void SetBlue(sal_uInt8 nBlue)
Sets the blue value.
Definition: color.hxx:202
Color(const basegfx::BColor &rBColor)
Definition: color.hxx:110
constexpr Color()
Definition: color.hxx:72
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_AUTHOR_TABLE_DEL(0xFC, 0xE6, 0xF4)
constexpr ::Color COL_GRAY3(0xCC, 0xCC, 0xCC)
constexpr ::Color COL_AUTHOR9_DARK(0xD1, 0x76, 0x00)
constexpr ::Color COL_AUTHOR7_LIGHT(0xF2, 0xFE, 0xB5)
ColorAlphaTag
Definition: color.hxx:46
@ ColorAlpha
Definition: color.hxx:46
constexpr ::Color COL_AUTHOR5_LIGHT(0xFF, 0xE3, 0xE5)
constexpr ::Color COL_AUTHOR8_DARK(0x35, 0x55, 0x6B)
constexpr ::Color COL_AUTHOR8_LIGHT(0xE2, 0xEA, 0xF1)
constexpr ::Color COL_AUTHOR7_NORMAL(0xED, 0xFC, 0xA3)
constexpr ::Color COL_AUTHOR_TABLE_INS(0xE1, 0xF2, 0xFA)
constexpr ::Color COL_AUTHOR2_LIGHT(0xE9, 0xF2, 0xFF)
constexpr ::Color COL_AUTHOR8_NORMAL(0xD3, 0xDE, 0xE8)
constexpr ::Color COL_GREEN(0x00, 0x80, 0x00)
constexpr ::Color COL_AUTHOR1_NORMAL(0xFF, 0xFF, 0x9E)
constexpr ::Color COL_AUTHOR9_LIGHT(0xFF, 0xE7, 0xC7)
constexpr ::Color COL_AUTHOR2_DARK(0x06, 0x46, 0xA2)
constexpr ::Color COL_AUTHOR1_LIGHT(0xFF, 0xFF, 0xC3)
constexpr ::Color COL_AUTHOR3_DARK(0x57, 0x9D, 0x1C)
constexpr ::Color COL_AUTHOR6_DARK(0x00, 0x80, 0x80)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_GRAY7(0x66, 0x66, 0x66)
constexpr ::Color COL_LIGHTCYAN(0x00, 0xFF, 0xFF)
constexpr ::Color COL_MAGENTA(0x80, 0x00, 0x80)
bool operator>>=(const css::uno::Any &rAny, Color &value)
Definition: color.hxx:425
void operator<<=(css::uno::Any &rAny, Color value)
Definition: color.hxx:434
constexpr ::Color COL_LIGHTMAGENTA(0xFF, 0x00, 0xFF)
constexpr ::Color COL_BROWN(0x80, 0x80, 0x00)
constexpr ::Color COL_YELLOW(0xFF, 0xFF, 0x00)
constexpr ::Color COL_ALPHA_OPAQUE(0xff, 0xff, 0xff)
constexpr ::Color COL_AUTHOR4_NORMAL(0xE4, 0xD2, 0xF5)
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
constexpr ::Color COL_AUTHOR7_DARK(0x8C, 0x84, 0x00)
ColorTransparencyTag
used to deliberately select the right constructor
Definition: color.hxx:45
@ ColorTransparency
Definition: color.hxx:45
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_LIGHTGRAYBLUE(0xE0, 0xE0, 0xFF)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &rStream, const Color &rColor)
Definition: color.hxx:506
constexpr ::Color COL_AUTHOR3_LIGHT(0xE2, 0xFA, 0xCF)
constexpr ::Color COL_AUTHOR5_NORMAL(0xFE, 0xCD, 0xD0)
constexpr ::Color COL_AUTHOR9_NORMAL(0xFF, 0xE2, 0xB9)
constexpr ::Color COL_ALPHA_TRANSPARENT(0x00, 0x00, 0x00)
constexpr ::Color COL_AUTHOR4_LIGHT(0xEF, 0xE4, 0xF8)
constexpr ::Color COL_AUTHOR5_DARK(0xC5, 0x00, 0x0B)
constexpr ::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
constexpr ::Color COL_CYAN(0x00, 0x80, 0x80)
constexpr ::Color COL_AUTHOR6_NORMAL(0xD2, 0xF6, 0xF6)
constexpr ::Color COL_LIGHTGREEN(0x00, 0xFF, 0x00)
constexpr ::Color COL_AUTHOR4_DARK(0x69, 0x2B, 0x9D)
constexpr ::Color COL_AUTHOR6_LIGHT(0xE6, 0xFA, 0xFA)
constexpr ::Color COL_AUTHOR2_NORMAL(0xD8, 0xE8, 0xFF)
constexpr ::Color COL_BLUE(0x00, 0x00, 0x80)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_AUTHOR1_DARK(0xC6, 0x92, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTHOR3_NORMAL(0xDA, 0xF8, 0xC1)
Any value
Degree100 abs(Degree100 x)
Definition: degree.hxx:42
Definition: color.hxx:30
constexpr sal_uInt32 extractRGB(sal_uInt32 nColorNumber)
Definition: color.hxx:32
constexpr sal_uInt8 ColorChannelMerge(sal_uInt8 nDst, sal_uInt8 nSrc, sal_uInt8 nSrcTrans)
Definition: color.hxx:37
sal_uInt8 getRed(IntSRGBA nCol)
sal_uInt8 getBlue(IntSRGBA nCol)
sal_uInt8 getGreen(IntSRGBA nCol)
#define TOOLS_DLLPUBLIC
Definition: toolsdllapi.h:28
unsigned char sal_uInt8
#define SAL_WARN_UNUSED
const sal_uInt8 R