Monotone-Parent: 26ae83c519411a3dbc3e5d45991a5ed34a6756db

Monotone-Revision: 520d3359a27192e2a9761e453f816cdd755a1509

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-10-31T22:56:53
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-10-31 22:56:53 +00:00
parent df2277f0bf
commit d3673933a8
3 changed files with 40 additions and 0 deletions
+32
View File
@@ -30,6 +30,23 @@
#import "UIxCalCalendarsListView.h"
static inline char
darkenedColor (const char value)
{
char newValue;
if (value >= '0' && value <= '9')
newValue = ((value - '0') / 2) + '0';
else if (value >= 'a' && value <= 'f')
newValue = ((value + 10 - 'a') / 2) + '0';
else if (value >= 'A' && value <= 'F')
newValue = ((value + 10 - 'A') / 2) + '0';
else
newValue = value;
return newValue;
}
@implementation UIxCalCalendarsListView
- (id) init
@@ -177,6 +194,21 @@
return [colors objectForKey: [currentContactPerson cn]];
}
- (NSString *) currentContactAptBorder
{
NSString *spanBG;
char cColor[8];
unsigned int count;
spanBG = [colors objectForKey: [currentContactPerson cn]];
[spanBG getCString: cColor];
cColor[7] = 0;
for (count = 1; count < 7; count++)
cColor[count] = darkenedColor(cColor[count]);
return [NSString stringWithCString: cColor];
}
- (NSDictionary *) colors
{
return colors;