22#include <unordered_map>
24#include <osl/diagnose.h>
29#include <oox/token/namespaces.hxx>
30#include <oox/token/tokens.hxx>
37struct PresetColorsPool
39 typedef ::std::vector< ::Color > ColorVector;
45 explicit PresetColorsPool();
48PresetColorsPool::PresetColorsPool() :
54 static const std::pair<sal_Int32, ::Color> spnDmlColors[] =
56 {XML_aliceBlue,
::Color(0xF0F8FF)}, {XML_antiqueWhite,
::Color(0xFAEBD7)},
57 {XML_aqua,
::Color(0x00FFFF)}, {XML_aquamarine,
::Color(0x7FFFD4)},
60 {XML_blanchedAlmond,
::Color(0xFFEBCD)}, {XML_blue,
::Color(0x0000FF)},
61 {XML_blueViolet,
::Color(0x8A2BE2)}, {XML_brown,
::Color(0xA52A2A)},
62 {XML_burlyWood,
::Color(0xDEB887)}, {XML_cadetBlue,
::Color(0x5F9EA0)},
63 {XML_chartreuse,
::Color(0x7FFF00)}, {XML_chocolate,
::Color(0xD2691E)},
64 {XML_coral,
::Color(0xFF7F50)}, {XML_cornflowerBlue,
::Color(0x6495ED)},
65 {XML_cornsilk,
::Color(0xFFF8DC)}, {XML_crimson,
::Color(0xDC143C)},
67 {XML_deepSkyBlue,
::Color(0x00BFFF)}, {XML_dimGray,
::Color(0x696969)},
69 {XML_dkGoldenrod,
::Color(0xB8860B)}, {XML_dkGray,
::Color(0xA9A9A9)},
70 {XML_dkGreen,
::Color(0x006400)}, {XML_dkKhaki,
::Color(0xBDB76B)},
71 {XML_dkMagenta,
::Color(0x8B008B)}, {XML_dkOliveGreen,
::Color(0x556B2F)},
72 {XML_dkOrange,
::Color(0xFF8C00)}, {XML_dkOrchid,
::Color(0x9932CC)},
74 {XML_dkSeaGreen,
::Color(0x8FBC8B)}, {XML_dkSlateBlue,
::Color(0x483D8B)},
75 {XML_dkSlateGray,
::Color(0x2F4F4F)}, {XML_dkTurquoise,
::Color(0x00CED1)},
76 {XML_dkViolet,
::Color(0x9400D3)}, {XML_dodgerBlue,
::Color(0x1E90FF)},
77 {XML_firebrick,
::Color(0xB22222)}, {XML_floralWhite,
::Color(0xFFFAF0)},
78 {XML_forestGreen,
::Color(0x228B22)}, {XML_fuchsia,
::Color(0xFF00FF)},
79 {XML_gainsboro,
::Color(0xDCDCDC)}, {XML_ghostWhite,
::Color(0xF8F8FF)},
82 {XML_greenYellow,
::Color(0xADFF2F)}, {XML_honeydew,
::Color(0xF0FFF0)},
83 {XML_hotPink,
::Color(0xFF69B4)}, {XML_indianRed,
::Color(0xCD5C5C)},
86 {XML_lavenderBlush,
::Color(0xFFF0F5)}, {XML_lawnGreen,
::Color(0x7CFC00)},
87 {XML_lemonChiffon,
::Color(0xFFFACD)}, {XML_lime,
::Color(0x00FF00)},
88 {XML_limeGreen,
::Color(0x32CD32)}, {XML_linen,
::Color(0xFAF0E6)},
90 {XML_ltCyan,
::Color(0xE0FFFF)}, {XML_ltGoldenrodYellow,
::Color(0xFAFA78)},
92 {XML_ltPink,
::Color(0xFFB6C1)}, {XML_ltSalmon,
::Color(0xFFA07A)},
93 {XML_ltSeaGreen,
::Color(0x20B2AA)}, {XML_ltSkyBlue,
::Color(0x87CEFA)},
94 {XML_ltSlateGray,
::Color(0x778899)}, {XML_ltSteelBlue,
::Color(0xB0C4DE)},
95 {XML_ltYellow,
::Color(0xFFFFE0)}, {XML_magenta,
::Color(0xFF00FF)},
96 {XML_maroon,
::Color(0x800000)}, {XML_medAquamarine,
::Color(0x66CDAA)},
97 {XML_medBlue,
::Color(0x0000CD)}, {XML_medOrchid,
::Color(0xBA55D3)},
98 {XML_medPurple,
::Color(0x9370DB)}, {XML_medSeaGreen,
::Color(0x3CB371)},
99 {XML_medSlateBlue,
::Color(0x7B68EE)}, {XML_medSpringGreen,
::Color(0x00FA9A)},
100 {XML_medTurquoise,
::Color(0x48D1CC)}, {XML_medVioletRed,
::Color(0xC71585)},
101 {XML_midnightBlue,
::Color(0x191970)}, {XML_mintCream,
::Color(0xF5FFFA)},
102 {XML_mistyRose,
::Color(0xFFE4E1)}, {XML_moccasin,
::Color(0xFFE4B5)},
103 {XML_navajoWhite,
::Color(0xFFDEAD)}, {XML_navy,
::Color(0x000080)},
105 {XML_oliveDrab,
::Color(0x6B8E23)}, {XML_orange,
::Color(0xFFA500)},
106 {XML_orangeRed,
::Color(0xFF4500)}, {XML_orchid,
::Color(0xDA70D6)},
107 {XML_paleGoldenrod,
::Color(0xEEE8AA)}, {XML_paleGreen,
::Color(0x98FB98)},
108 {XML_paleTurquoise,
::Color(0xAFEEEE)}, {XML_paleVioletRed,
::Color(0xDB7093)},
109 {XML_papayaWhip,
::Color(0xFFEFD5)}, {XML_peachPuff,
::Color(0xFFDAB9)},
111 {XML_plum,
::Color(0xDDA0DD)}, {XML_powderBlue,
::Color(0xB0E0E6)},
113 {XML_rosyBrown,
::Color(0xBC8F8F)}, {XML_royalBlue,
::Color(0x4169E1)},
114 {XML_saddleBrown,
::Color(0x8B4513)}, {XML_salmon,
::Color(0xFA8072)},
115 {XML_sandyBrown,
::Color(0xF4A460)}, {XML_seaGreen,
::Color(0x2E8B57)},
116 {XML_seaShell,
::Color(0xFFF5EE)}, {XML_sienna,
::Color(0xA0522D)},
117 {XML_silver,
::Color(0xC0C0C0)}, {XML_skyBlue,
::Color(0x87CEEB)},
118 {XML_slateBlue,
::Color(0x6A5ACD)}, {XML_slateGray,
::Color(0x708090)},
119 {XML_snow,
::Color(0xFFFAFA)}, {XML_springGreen,
::Color(0x00FF7F)},
122 {XML_tomato,
::Color(0xFF6347)}, {XML_turquoise,
::Color(0x40E0D0)},
124 {XML_white,
::Color(0xFFFFFF)}, {XML_whiteSmoke,
::Color(0xF5F5F5)},
125 {XML_yellow,
::Color(0xFFFF00)}, {XML_yellowGreen,
::Color(0x9ACD32)}
127 for(
auto const& nEntry : spnDmlColors)
128 maDmlColors[
static_cast< size_t >(nEntry.first) ] = nEntry.second;
131 static const std::pair<sal_Int32, ::Color> spnVmlColors[] =
142 for(
auto const& nEntry : spnVmlColors)
143 maVmlColors[
static_cast< size_t >(nEntry.first) ] = nEntry.second;
146 static const std::pair<sal_Int32, ::Color> spnHighlightColors[] =
151 {XML_darkCyan,
::Color(0x008B8B)}, {XML_darkGray,
::Color(0xA9A9A9)},
152 {XML_darkGreen,
::Color(0x006400)}, {XML_darkMagenta,
::Color(0x800080)},
153 {XML_darkRed,
::Color(0x8B0000)}, {XML_darkYellow,
::Color(0x808000)},
154 {XML_green,
::Color(0x00FF00)}, {XML_lightGray,
::Color(0xD3D3D3)},
158 for (
auto const& nEntry : spnHighlightColors)
162PresetColorsPool& StaticPresetColorsPool()
164 static PresetColorsPool thePool;
168const double DEC_GAMMA = 2.3;
169const double INC_GAMMA = 1.0 / DEC_GAMMA;
171void lclRgbToRgbComponents( sal_Int32& ornR, sal_Int32& ornG, sal_Int32& ornB,
::Color nRgb )
178sal_Int32 lclRgbComponentsToRgb( sal_Int32 nR, sal_Int32 nG, sal_Int32 nB )
180 return static_cast< sal_Int32
>( (nR << 16) | (nG << 8) | nB );
183sal_Int32 lclRgbCompToCrgbComp( sal_Int32 nRgbComp )
185 return static_cast< sal_Int32
>( nRgbComp *
MAX_PERCENT / 255 );
188sal_Int32 lclCrgbCompToRgbComp( sal_Int32 nCrgbComp )
190 return static_cast< sal_Int32
>( nCrgbComp * 255 /
MAX_PERCENT );
193sal_Int32 lclGamma( sal_Int32 nComp,
double fGamma )
195 return static_cast< sal_Int32
>( pow(
static_cast< double >( nComp ) /
MAX_PERCENT, fGamma ) *
MAX_PERCENT + 0.5 );
198void lclSetValue( sal_Int32& ornValue, sal_Int32 nNew, sal_Int32 nMax =
MAX_PERCENT )
200 OSL_ENSURE( (0 <= nNew) && (nNew <= nMax),
"lclSetValue - invalid value" );
201 if( (0 <= nNew) && (nNew <= nMax) )
205void lclModValue( sal_Int32& ornValue, sal_Int32 nMod, sal_Int32 nMax =
MAX_PERCENT )
207 OSL_ENSURE( (0 <= nMod),
"lclModValue - invalid modificator" );
208 ornValue = getLimitedValue< sal_Int32, double >(
static_cast< double >( ornValue ) * nMod /
MAX_PERCENT, 0, nMax );
211void lclOffValue( sal_Int32& ornValue, sal_Int32 nOff, sal_Int32 nMax =
MAX_PERCENT )
213 OSL_ENSURE( (-nMax <= nOff) && (nOff <= nMax),
"lclOffValue - invalid offset" );
214 ornValue = getLimitedValue< sal_Int32, sal_Int32 >( ornValue + nOff, 0, nMax );
221 static std::unordered_map<OUString, model::ThemeColorType>
const aSchemeColorNameToIndex{
250 auto aIterator = aSchemeColorNameToIndex.find(rSchemeName);
251 if (aIterator == aSchemeColorNameToIndex.end())
254 return aIterator->second;
272 return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb;
281 return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb;
290 return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb;
305 OSL_ENSURE( (0 <= nRgb) && (nRgb <= 0xFFFFFF),
"Color::setSrgbClr - invalid RGB value" );
312 OSL_ENSURE( (0 <= nR) && (nR <=
MAX_PERCENT),
"Color::setScrgbClr - invalid red value" );
313 OSL_ENSURE( (0 <= nG) && (nG <=
MAX_PERCENT),
"Color::setScrgbClr - invalid green value" );
314 OSL_ENSURE( (0 <= nB) && (nB <=
MAX_PERCENT),
"Color::setScrgbClr - invalid blue value" );
323 OSL_ENSURE( (0 <= nHue) && (nHue <=
MAX_DEGREE),
"Color::setHslClr - invalid hue value" );
324 OSL_ENSURE( (0 <= nSat) && (nSat <=
MAX_PERCENT),
"Color::setHslClr - invalid saturation value" );
325 OSL_ENSURE( (0 <= nLum) && (nLum <=
MAX_PERCENT),
"Color::setHslClr - invalid luminance value" );
327 mnC1 = getLimitedValue< sal_Int32, sal_Int32 >( nHue, 0,
MAX_DEGREE );
328 mnC2 = getLimitedValue< sal_Int32, sal_Int32 >( nSat, 0,
MAX_PERCENT );
329 mnC3 = getLimitedValue< sal_Int32, sal_Int32 >( nLum, 0,
MAX_PERCENT );
335 OSL_ENSURE( sal_Int32(nRgbValue) >= 0,
"Color::setPrstClr - invalid preset color token" );
336 if( sal_Int32(nRgbValue) >= 0 )
343 OSL_ENSURE( sal_Int32(nRgbValue) >= 0,
"Color::setPrstClr - invalid preset color token" );
344 if ( sal_Int32(nRgbValue) >= 0 )
357 OSL_ENSURE( nPaletteIdx >= 0,
"Color::setPaletteClr - invalid palette index" );
364 OSL_ENSURE( (-1 <= nLastRgb) && (nLastRgb <= 0xFFFFFF),
"Color::setSysClr - invalid RGB value" );
375 sal_Int32
nToken = getBaseToken( nElement );
387 pInteropTransformations[nSize].Value <<=
nValue;
416 case XML_red:
return "red";
417 case XML_redMod:
return "redMod";
418 case XML_redOff:
return "redOff";
419 case XML_green:
return "green";
420 case XML_greenMod:
return "greenMod";
421 case XML_greenOff:
return "greenOff";
422 case XML_blue:
return "blue";
423 case XML_blueMod:
return "blueMod";
424 case XML_blueOff:
return "blueOff";
425 case XML_alpha:
return "alpha";
426 case XML_alphaMod:
return "alphaMod";
427 case XML_alphaOff:
return "alphaOff";
428 case XML_hue:
return "hue";
429 case XML_hueMod:
return "hueMod";
430 case XML_hueOff:
return "hueOff";
431 case XML_sat:
return "sat";
432 case XML_satMod:
return "satMod";
433 case XML_satOff:
return "satOff";
434 case XML_lum:
return "lum";
435 case XML_lumMod:
return "lumMod";
436 case XML_lumOff:
return "lumOff";
437 case XML_shade:
return "shade";
438 case XML_tint:
return "tint";
439 case XML_gray:
return "gray";
440 case XML_comp:
return "comp";
441 case XML_inv:
return "inv";
442 case XML_gamma:
return "gamma";
443 case XML_invGamma:
return "invGamma";
445 SAL_WARN(
"oox.drawingml",
"Color::getColorTransformationName - unexpected transformation type" );
453 else if(
sName ==
u"redMod" )
455 else if(
sName ==
u"redOff" )
457 else if(
sName ==
u"green" )
459 else if(
sName ==
u"greenMod" )
461 else if(
sName ==
u"greenOff" )
463 else if(
sName ==
u"blue" )
465 else if(
sName ==
u"blueMod" )
467 else if(
sName ==
u"blueOff" )
469 else if(
sName ==
u"alpha" )
471 else if(
sName ==
u"alphaMod" )
473 else if(
sName ==
u"alphaOff" )
475 else if(
sName ==
u"hue" )
477 else if(
sName ==
u"hueMod" )
479 else if(
sName ==
u"hueOff" )
481 else if(
sName ==
u"sat" )
483 else if(
sName ==
u"satMod" )
485 else if(
sName ==
u"satOff" )
487 else if(
sName ==
u"lum" )
489 else if(
sName ==
u"lumMod" )
491 else if(
sName ==
u"lumOff" )
493 else if(
sName ==
u"shade" )
495 else if(
sName ==
u"tint" )
497 else if(
sName ==
u"gray" )
499 else if(
sName ==
u"comp" )
501 else if(
sName ==
u"inv" )
503 else if(
sName ==
u"gamma" )
505 else if(
sName ==
u"invGamma" )
508 SAL_WARN(
"oox.drawingml",
"Color::getColorTransformationToken - unexpected transformation type" );
514 if (
getColor(rGraphicHelper, nPhClr) != rOther.
getColor(rGraphicHelper, nPhClr))
529 switch(aTransform.mnToken)
533 return aTransform.mnValue/10;
536 return -aTransform.mnValue/10;
546 if (rTransform.mnToken != XML_lumMod)
552 return rTransform.mnValue / 10;
562 if (rTransform.mnToken != XML_lumOff)
568 return rTransform.mnValue / 10;
576 const sal_Int32 nTempC1 =
mnC1;
577 const sal_Int32 nTempC2 =
mnC2;
578 const sal_Int32 nTempC3 =
mnC3;
602 switch( transform.mnToken )
604 case XML_red:
toCrgb(); lclSetValue(
mnC1, transform.mnValue );
break;
605 case XML_redMod:
toCrgb(); lclModValue(
mnC1, transform.mnValue );
break;
606 case XML_redOff:
toCrgb(); lclOffValue(
mnC1, transform.mnValue );
break;
607 case XML_green:
toCrgb(); lclSetValue(
mnC2, transform.mnValue );
break;
608 case XML_greenMod:
toCrgb(); lclModValue(
mnC2, transform.mnValue );
break;
609 case XML_greenOff:
toCrgb(); lclOffValue(
mnC2, transform.mnValue );
break;
610 case XML_blue:
toCrgb(); lclSetValue(
mnC3, transform.mnValue );
break;
611 case XML_blueMod:
toCrgb(); lclModValue(
mnC3, transform.mnValue );
break;
612 case XML_blueOff:
toCrgb(); lclOffValue(
mnC3, transform.mnValue );
break;
617 case XML_sat:
toHsl(); lclSetValue(
mnC2, transform.mnValue );
break;
618 case XML_satMod:
toHsl(); lclModValue(
mnC2, transform.mnValue );
break;
619 case XML_satOff:
toHsl(); lclOffValue(
mnC2, transform.mnValue );
break;
623 lclSetValue(
mnC3, transform.mnValue );
629 lclModValue(
mnC3, transform.mnValue );
635 lclOffValue(
mnC3, transform.mnValue );
643 OSL_ENSURE( (0 <= transform.mnValue) && (transform.mnValue <=
MAX_PERCENT),
"Color::getColor - invalid shade value" );
644 if( (0 <= transform.mnValue) && (transform.mnValue <=
MAX_PERCENT) )
646 double fFactor =
static_cast< double >( transform.mnValue ) /
MAX_PERCENT;
647 mnC1 =
static_cast< sal_Int32
>(
mnC1 * fFactor );
648 mnC2 =
static_cast< sal_Int32
>(
mnC2 * fFactor );
649 mnC3 =
static_cast< sal_Int32
>(
mnC3 * fFactor );
655 OSL_ENSURE( (0 <= transform.mnValue) && (transform.mnValue <=
MAX_PERCENT),
"Color::getColor - invalid tint value" );
656 if( (0 <= transform.mnValue) && (transform.mnValue <=
MAX_PERCENT) )
658 double fFactor =
static_cast< double >( transform.mnValue ) /
MAX_PERCENT;
664 case XLS_TOKEN( tint ):
667 OSL_ENSURE( (-
MAX_PERCENT <= transform.mnValue) && (transform.mnValue <=
MAX_PERCENT),
"Color::getColor - invalid tint value" );
668 if( (-
MAX_PERCENT <= transform.mnValue) && (transform.mnValue < 0) )
673 else if( (0 < transform.mnValue) && (transform.mnValue <=
MAX_PERCENT) )
727 sal_Int32 nRet =
mnC1;
759 return sal_Int16(eThemeType);
779 mnC1 = lclCrgbCompToRgbComp( lclGamma(
mnC1, INC_GAMMA ) );
780 mnC2 = lclCrgbCompToRgbComp( lclGamma(
mnC2, INC_GAMMA ) );
781 mnC3 = lclCrgbCompToRgbComp( lclGamma(
mnC3, INC_GAMMA ) );
786 double fR = 0.0, fG = 0.0, fB = 0.0;
795 if( fHue <= 1.0 ) { fR = 1.0; fG = fHue; }
796 else if( fHue <= 2.0 ) { fR = 2.0 - fHue; fG = 1.0; }
797 else if( fHue <= 3.0 ) { fG = 1.0; fB = fHue - 2.0; }
798 else if( fHue <= 4.0 ) { fG = 4.0 - fHue; fB = 1.0; }
799 else if( fHue <= 5.0 ) { fR = fHue - 4.0; fB = 1.0; }
800 else { fR = 1.0; fB = 6.0 - fHue; }
804 fR = (fR - 0.5) * fSat + 0.5;
805 fG = (fG - 0.5) * fSat + 0.5;
806 fB = (fB - 0.5) * fSat + 0.5;
812 double fShade = fLum + 1.0;
817 else if( fLum > 0.0 )
819 double fTint = 1.0 - fLum;
820 fR = 1.0 - ((1.0 - fR) * fTint);
821 fG = 1.0 - ((1.0 - fG) * fTint);
822 fB = 1.0 - ((1.0 - fB) * fTint);
825 mnC1 =
static_cast< sal_Int32
>( fR * 255.0 + 0.5 );
826 mnC2 =
static_cast< sal_Int32
>( fG * 255.0 + 0.5 );
827 mnC3 =
static_cast< sal_Int32
>( fB * 255.0 + 0.5 );
831 OSL_FAIL(
"Color::toRgb - unexpected color mode" );
844 mnC1 = lclGamma( lclRgbCompToCrgbComp(
mnC1 ), DEC_GAMMA );
845 mnC2 = lclGamma( lclRgbCompToCrgbComp(
mnC2 ), DEC_GAMMA );
846 mnC3 = lclGamma( lclRgbCompToCrgbComp(
mnC3 ), DEC_GAMMA );
852 OSL_FAIL(
"Color::toCrgb - unexpected color mode" );
866 double fR =
static_cast< double >(
mnC1 ) / 255.0;
867 double fG =
static_cast< double >(
mnC2 ) / 255.0;
868 double fB =
static_cast< double >(
mnC3 ) / 255.0;
869 double fMin = ::std::min( ::std::min( fR, fG ), fB );
870 double fMax = ::std::max( ::std::max( fR, fG ), fB );
871 double fD = fMax - fMin;
873 using ::rtl::math::approxEqual;
878 else if( approxEqual(fMax, fR, 64) )
880 else if( approxEqual(fMax, fG, 64) )
881 mnC1 =
static_cast< sal_Int32
>( ((fB - fR) / fD * 60.0 + 120.0) *
PER_DEGREE + 0.5 );
883 mnC1 =
static_cast< sal_Int32
>( ((fR - fG) / fD * 60.0 + 240.0) *
PER_DEGREE + 0.5 );
886 mnC3 =
static_cast< sal_Int32
>( (fMin + fMax) / 2.0 *
MAX_PERCENT + 0.5 );
892 mnC2 =
static_cast< sal_Int32
>( fD / (fMin + fMax) *
MAX_PERCENT + 0.5 );
894 mnC2 =
static_cast< sal_Int32
>( fD / (2.0 - fMax - fMin) *
MAX_PERCENT + 0.5 );
901 OSL_FAIL(
"Color::toHsl - unexpected color mode" );
sal_uInt8 GetBlue() const
sal_uInt8 GetGreen() const
static const VectorType::value_type * getVectorElement(const VectorType &rVector, sal_Int32 nIndex)
Returns the pointer to an existing element of the passed vector, or a null pointer,...
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
virtual ::Color getPaletteColor(sal_Int32 nPaletteIdx) const
Derived classes may implement to resolve a palette index to an RGB color.
virtual ::Color getSchemeColor(sal_Int32 nToken) const
Derived classes may implement to resolve a scheme color from the passed XML token identifier.
::Color getSystemColor(sal_Int32 nToken, ::Color nDefaultRgb=API_RGB_TRANSPARENT) const
Returns a system color specified by the passed XML token identifier.
void toCrgb() const
Converts the color components to CRGB values (gamma corrected percentage).
sal_Int16 getTintOrShade() const
sal_Int16 getLumMod() const
sal_Int16 getTransparency() const
Returns the transparency of the color (0 = opaque, 100 = full transparent).
void addTransformation(sal_Int32 nElement, sal_Int32 nValue=-1)
Inserts the passed color transformation.
void setPrstClr(sal_Int32 nToken)
Sets a predefined color from the a:prstClr element.
void setPaletteClr(sal_Int32 nPaletteIdx)
Sets a palette color index.
void setScrgbClr(sal_Int32 nR, sal_Int32 nG, sal_Int32 nB)
Sets the percentual RGB values from the a:scrgbClr element.
@ COLOR_SYSTEM
Color from application defined palette.
@ COLOR_RGB
Color is not used, or undefined.
@ COLOR_HSL
Relative RGB (r/g/b: 0...100000).
@ COLOR_FINAL
Placeholder color in theme style lists.
@ COLOR_CRGB
Absolute RGB (r/g/b: 0...255).
@ COLOR_PALETTE
Color from scheme.
@ COLOR_SCHEME
HSL (hue: 0...21600000, sat/lum: 0...100000).
@ COLOR_PH
Color from system palette.
static OUString getColorTransformationName(sal_Int32 nElement)
Translates between color transformation tokens and their names.
void setResolvedRgb(::Color nRgb) const
Internal helper for getColor().
void toRgb() const
Converts the color components to RGB values.
void addExcelTintTransformation(double fTint)
Inserts Excel specific color tint (-1.0...0.0 = shade, 0.0...1.0 = tint).
void setSchemeClr(sal_Int32 nToken)
Sets a scheme color from the a:schemeClr element.
void addChartTintTransformation(double fTint)
Inserts Chart specific color tint (-1.0...0.0 = shade, 0.0...1.0 = tint).
void clearTransformations()
Removes all color transformations.
sal_Int32 mnC1
Color transformations.
void setUnused()
Sets the color to unused state.
void setHighlight(sal_Int32 nToken)
Sets a predefined color from the w:highlight element.
css::uno::Sequence< css::beans::PropertyValue > maInteropTransformations
Scheme name from the a:schemeClr element for interoperability purposes.
sal_Int32 mnAlpha
Blue, blue%, or luminance.
void setHslClr(sal_Int32 nHue, sal_Int32 nSat, sal_Int32 nLum)
Sets the HSL values from the a:hslClr element.
sal_Int16 getLumOff() const
void clearTransparence()
Removes transparence from the color.
bool equals(const Color &rOther, const GraphicHelper &rGraphicHelper, ::Color nPhClr) const
Compares this color with rOther.
std::vector< Transformation > maTransforms
Current color mode.
OUString msSchemeName
Alpha value (color opacity).
void setSysClr(sal_Int32 nToken, sal_Int32 nLastRgb)
Sets a system color from the a:sysClr element.
void toHsl() const
Converts the color components to HSL values.
sal_Int32 mnC2
Red, red%, hue, scheme token, palette index, system token, or final RGB.
bool hasTransparency() const
Returns true, if the color is transparent.
::Color getDmlPresetColor(sal_Int32 nToken, ::Color nDefaultRgb)
Returns the RGB value for the passed DrawingML color token, or nDefaultRgb on error.
sal_Int16 getSchemeColorIndex() const
static sal_Int32 getColorTransformationToken(std::u16string_view sName)
Translates between color transformation token names and the corresponding token.
sal_Int32 mnC3
Green, green%, saturation, or system default RGB.
::Color getHighlightColor(sal_Int32 nToken, ::Color nDefaultRgb)
Returns the RGB value for the passed VML color token, or nDefaultRgb on error.
::Color getVmlPresetColor(sal_Int32 nToken, ::Color nDefaultRgb)
Returns the RGB value for the passed VML color token, or nDefaultRgb on error.
::Color getColor(const GraphicHelper &rGraphicHelper, ::Color nPhClr=API_RGB_TRANSPARENT) const
Returns the final RGB color value.
void setSrgbClr(sal_Int32 nRgb)
Sets an RGB value (hexadecimal RRGGBB) from the a:srgbClr element.
ColorVector maHighlightColors
Predefined colors in VML, indexed by XML token.
ColorVector maVmlColors
Predefined colors in DrawingML, indexed by XML token.
#define SAL_WARN(area, stream)
model::ThemeColorType schemeNameToThemeColorType(OUString const &rSchemeName)
const sal_Int32 MAX_DEGREE
const sal_Int32 MAX_PERCENT
const sal_Int32 PER_DEGREE
const sal_Int32 PER_PERCENT
const ::Color API_RGB_TRANSPARENT(ColorTransparency, 0xffffffff)
Transparent color for API calls.