summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-11-18 23:00:49 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-11-18 23:00:49 -0800
commit6a575b5e80ea78e300112949b58ab7315f7c40b4 (patch)
tree450ac36b558cd1af02cf9e942e6fcf5f8cb5f4c5
parentc882c7ee3b7e11b548c1b60ea46326c62c3eeb87 (diff)
Break CYColor::Create_ from CYColor::{CYColor,Set}.
-rw-r--r--MobileCydia.mm10
1 files changed, 7 insertions, 3 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 7197a31..950012c 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -951,6 +951,11 @@ class CYColor {
private:
CGColorRef color_;
+ static CGColorRef Create_(CGColorSpaceRef space, float red, float green, float blue, float alpha) {
+ CGFloat color[] = {red, green, blue, alpha};
+ return CGColorCreate(space, color);
+ }
+
public:
CYColor() :
color_(NULL)
@@ -958,7 +963,7 @@ class CYColor {
}
CYColor(CGColorSpaceRef space, float red, float green, float blue, float alpha) :
- color_(NULL)
+ color_(Create_(space, red, green, blue, alpha))
{
Set(space, red, green, blue, alpha);
}
@@ -974,8 +979,7 @@ class CYColor {
void Set(CGColorSpaceRef space, float red, float green, float blue, float alpha) {
Clear();
- float color[] = {red, green, blue, alpha};
- color_ = CGColorCreate(space, (CGFloat *) color);
+ color_ = Create_(space, red, green, blue, alpha);
}
operator CGColorRef() {