2012-07-28 16:44:47 +00:00
|
|
|
# callirhoe - high quality calendar rendering
|
|
|
|
# Copyright (C) 2012 George M. Tzoumas
|
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see http://www.gnu.org/licenses/
|
|
|
|
|
2012-08-06 10:50:18 +00:00
|
|
|
# --- style.rainbow ---
|
2012-07-28 16:44:47 +00:00
|
|
|
|
2014-09-03 12:56:19 +00:00
|
|
|
"""module defining rainbow color style"""
|
2012-08-06 10:50:18 +00:00
|
|
|
|
2020-02-19 00:56:16 +01:00
|
|
|
from . import default
|
2012-08-06 10:50:18 +00:00
|
|
|
|
2013-12-29 23:56:21 +00:00
|
|
|
# day of week
|
2012-08-06 10:50:18 +00:00
|
|
|
class dow(default.dow): pass
|
2012-07-28 16:44:47 +00:00
|
|
|
|
|
|
|
# day of month
|
2012-08-06 10:50:18 +00:00
|
|
|
class dom(default.dom): pass
|
2012-07-28 16:44:47 +00:00
|
|
|
|
2012-08-06 10:50:18 +00:00
|
|
|
class dom_weekend(default.dom_weekend): pass
|
2012-07-28 16:44:47 +00:00
|
|
|
|
2012-08-06 10:50:18 +00:00
|
|
|
class dom_holiday(default.dom_holiday): pass
|
2012-07-28 16:44:47 +00:00
|
|
|
|
2013-12-29 20:56:48 +00:00
|
|
|
class dom_weekend_holiday(default.dom_weekend_holiday): pass
|
2012-07-28 16:44:47 +00:00
|
|
|
|
2015-08-11 23:34:43 +02:00
|
|
|
class dom_phantom(default.dom_phantom): pass
|
|
|
|
|
|
|
|
class dom_weekend_phantom(default.dom_weekend_phantom): pass
|
|
|
|
|
2013-12-29 23:56:21 +00:00
|
|
|
class dom_multi(default.dom_multi): pass
|
|
|
|
|
|
|
|
class dom_weekend_multi(default.dom_weekend_multi): pass
|
|
|
|
|
2012-08-06 10:50:18 +00:00
|
|
|
from lib.geom import color_mix, color_scale, color_auto_fg
|
2012-07-28 16:44:47 +00:00
|
|
|
|
2012-08-06 10:50:18 +00:00
|
|
|
class month(default.month):
|
|
|
|
winter = (0,0.5,1)
|
|
|
|
spring = (0.0,0.7,0.0)
|
2012-07-28 16:44:47 +00:00
|
|
|
summer = (1,0.3,0)
|
|
|
|
autumn = (0.9,0.9,0)
|
2012-08-06 10:50:18 +00:00
|
|
|
_c1 = ((0,0,0), winter,
|
2012-07-28 16:44:47 +00:00
|
|
|
color_mix(winter,spring,0.66), color_mix(winter,spring,0.33), spring, # april
|
|
|
|
color_mix(spring,summer,0.66), color_mix(spring,summer,0.33), summer, # july
|
|
|
|
color_mix(summer,autumn,0.66), color_mix(summer,autumn,0.33), autumn, # october
|
|
|
|
color_mix(autumn,winter,0.66), color_mix(autumn,winter,0.33)) # december
|
2020-02-19 00:56:16 +01:00
|
|
|
color_map_bg = ([color_scale(x, 0.5) for x in _c1], _c1)
|
2012-08-06 10:50:18 +00:00
|
|
|
color_map_fg = (((1,1,1),)*13, ((0,0,0),)*13)
|
|
|
|
# map(lambda x: color_auto_fg(x), color_map_bg[1]
|