Package style :: Module rainbow
[hide private]
[frames] | no frames]

Source Code for Module style.rainbow

 1  #    callirhoe - high quality calendar rendering 
 2  #    Copyright (C) 2012 George M. Tzoumas 
 3   
 4  #    This program is free software: you can redistribute it and/or modify 
 5  #    it under the terms of the GNU General Public License as published by 
 6  #    the Free Software Foundation, either version 3 of the License, or 
 7  #    (at your option) any later version. 
 8  # 
 9  #    This program is distributed in the hope that it will be useful, 
10  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
11  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
12  #    GNU General Public License for more details. 
13  # 
14  #    You should have received a copy of the GNU General Public License 
15  #    along with this program.  If not, see http://www.gnu.org/licenses/ 
16   
17  # --- style.rainbow --- 
18   
19  """module defining rainbow color style""" 
20   
21  import default 
22   
23  # day of week 
24 -class dow(default.dow): pass
25 26 # day of month
27 -class dom(default.dom): pass
28
29 -class dom_weekend(default.dom_weekend): pass
30
31 -class dom_holiday(default.dom_holiday): pass
32
33 -class dom_weekend_holiday(default.dom_weekend_holiday): pass
34
35 -class dom_multi(default.dom_multi): pass
36
37 -class dom_weekend_multi(default.dom_weekend_multi): pass
38 39 from lib.geom import color_mix, color_scale, color_auto_fg 40
41 -class month(default.month):
42 winter = (0,0.5,1) 43 spring = (0.0,0.7,0.0) 44 summer = (1,0.3,0) 45 autumn = (0.9,0.9,0) 46 _c1 = ((0,0,0), winter, 47 color_mix(winter,spring,0.66), color_mix(winter,spring,0.33), spring, # april 48 color_mix(spring,summer,0.66), color_mix(spring,summer,0.33), summer, # july 49 color_mix(summer,autumn,0.66), color_mix(summer,autumn,0.33), autumn, # october 50 color_mix(autumn,winter,0.66), color_mix(autumn,winter,0.33)) # december 51 color_map_bg = (map(lambda x: color_scale(x, 0.5), _c1), _c1) 52 color_map_fg = (((1,1,1),)*13, ((0,0,0),)*13)
53 # map(lambda x: color_auto_fg(x), color_map_bg[1] 54