summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRene Engelhard <rene@debian.org>2011-01-02 01:06:39 +0100
committerRene Engelhard <rene@debian.org>2011-01-02 01:06:39 +0100
commit0d235638711dff16eb7116797918145d28fff337 (patch)
treeef2827ed7a6807d81f0a16c94e60055928b8c422
parent1b09144f7a76c1a9cd80c043f384af772d8b7a48 (diff)
parent24ee7af7b359440eb2cd2a83d145d3e4ff974dcd (diff)
Merge remote branch 'origin/libreoffice-3-3'
Conflicts: slideshow/source/engine/color.cxx
-rw-r--r--slideshow/source/engine/color.cxx51
1 files changed, 51 insertions, 0 deletions
diff --git a/slideshow/source/engine/color.cxx b/slideshow/source/engine/color.cxx
index dfa8b1409706..8079cf65100a 100644
--- a/slideshow/source/engine/color.cxx
+++ b/slideshow/source/engine/color.cxx
@@ -228,6 +228,57 @@ namespace slideshow
return maHSLTriple.mnLuminance;
}
+ double HSLColor::getRed() const
+ {
+ if( ::basegfx::fTools::equalZero( getSaturation() ) )
+ return getLuminance();
+
+ return hsl2rgbHelper( 2.0*getLuminance() - mnMagicValue,
+ mnMagicValue,
+ getHue() + 120.0 );
+ }
+
+ double HSLColor::getGreen() const
+ {
+ if( ::basegfx::fTools::equalZero( getSaturation() ) )
+ return getLuminance();
+
+ return hsl2rgbHelper( 2.0*getLuminance() - mnMagicValue,
+ mnMagicValue,
+ getHue() );
+ }
+
+ double HSLColor::getBlue() const
+ {
+ if( ::basegfx::fTools::equalZero( getSaturation() ) )
+ return getLuminance();
+
+ return hsl2rgbHelper( 2.0*getLuminance() - mnMagicValue,
+ mnMagicValue,
+ getHue() - 120.0 );
+ }
+
+ RGBColor HSLColor::getRGBColor() const
+ {
+ RGBColor::RGBTriple aColor( hsl2rgb( getHue(),
+ getSaturation(),
+ getLuminance() ) );
+ return RGBColor( aColor.mnRed, aColor.mnGreen, aColor.mnBlue );
+ }
+
+ RGBColor::RGBColor(const RGBColor& rLHS)
+ : maRGBTriple( rLHS.maRGBTriple )
+ {
+ }
+
+ RGBColor& RGBColor::operator=( const RGBColor& rLHS ){
+
+ maRGBTriple.mnRed = rLHS.getRed();
+ maRGBTriple.mnGreen = rLHS.getGreen();
+ maRGBTriple.mnBlue = rLHS.getBlue();
+ return *this;
+ }
+
HSLColor operator+( const HSLColor& rLHS, const HSLColor& rRHS )
{
return HSLColor( rLHS.getHue() + rRHS.getHue(),