mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-20 10:55:25 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user