Author: Carlos Lopez <[email protected]>
Date: Thu May 31 21:14:03 2012 +0200
Constructor for CairoColor based on Color
---
synfig-core/src/synfig/color.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/synfig-core/src/synfig/color.h b/synfig-core/src/synfig/color.h
index f40ca94..8e0e93d 100644
--- a/synfig-core/src/synfig/color.h
+++ b/synfig-core/src/synfig/color.h
@@ -710,6 +710,14 @@ public:
CairoColor(const CairoColor& c, const unsigned char A):
a_(A), r_(c.r_), g_(c.g_), b_(c.b_) { }
CairoColor(const CairoColor& c): a_(c.a_), r_(c.r_), g_(c.g_), b_(c.b_)
{ }
+ // Conversor constructor
+ CairoColor(Color& c)
+ {
+
set_r((ceil()-floor())*c.get_r()/(Color::ceil()-Color::floor()));
+
set_g((ceil()-floor())*c.get_g()/(Color::ceil()-Color::floor()));
+
set_b((ceil()-floor())*c.get_b()/(Color::ceil()-Color::floor()));
+
set_a((ceil()-floor())*c.get_a()/(Color::ceil()-Color::floor()));
+ }
const unsigned char get_r()const { return r_; }
const unsigned char get_g()const { return g_; }
const unsigned char get_b()const { return b_; }
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl