@@ -50,17 +50,18 @@ class EventShowAs(Enum):
5050
5151
5252class CalendarColors (Enum ):
53- LightBlue = 0
54- LightGreen = 1
55- LightOrange = 2
56- LightGray = 3
57- LightYellow = 4
58- LightTeal = 5
59- LightPink = 6
60- LightBrown = 7
61- LightRed = 8
62- MaxColor = 9
63- Auto = - 1
53+ LightBlue = 'lightBlue'
54+ LightGreen = 'lightGreen'
55+ LightOrange = 'lightOrange'
56+ LightGray = 'lightGray'
57+ LightYellow = 'lightYellow'
58+ LightTeal = 'lightTeal'
59+ LightPink = 'lightPink'
60+ LightBrown = 'lightBrown'
61+ LightRed = 'lightRed'
62+ MaxColor = 'maxColor'
63+ Auto = 'auto'
64+
6465
6566
6667class EventType (Enum ):
@@ -1494,11 +1495,11 @@ def __init__(self, *, parent=None, con=None, **kwargs):
14941495 self .calendar_id = cloud_data .get (self ._cc ('id' ), None )
14951496 self .__owner = self ._recipient_from_cloud (
14961497 cloud_data .get (self ._cc ('owner' ), {}), field = 'owner' )
1497- color = cloud_data .get (self ._cc ('color' ), - 1 )
1498- if isinstance ( color , str ) :
1499- color = - 1 if color == 'auto' else color
1500- # TODO: other string colors?
1501- self .color = CalendarColors (color )
1498+ color = cloud_data .get (self ._cc ('color' ), 'auto' )
1499+ try :
1500+ self . color = CalendarColors ( color )
1501+ except :
1502+ self .color = CalendarColors ('auto' )
15021503 self .can_edit = cloud_data .get (self ._cc ('canEdit' ), False )
15031504 self .can_share = cloud_data .get (self ._cc ('canShare' ), False )
15041505 self .can_view_private_items = cloud_data .get (
0 commit comments