lila/bin/gen/generate_css_for_a_board_wi...

19 lines
800 B
Python
Raw Normal View History

2020-06-23 01:13:50 -06:00
#! /usr/bin/python3
#config
themes = {
2012-06-19 09:39:09 -06:00
'grey': ['#fff', '#c4c4c4'],
2012-06-16 18:54:34 -06:00
'green': ['#ffffdd', '#86a666'],
'blue': ['#dee3e6', '#8ca2ad'],
'brown': ['#f0d9b5', '#b58863']
}
2013-05-15 21:08:52 -06:00
blackPattern = 'body.{name} #GameBoard td.blackSquare, body.{name} #GameBoard td.highlightBlackSquare, body.{name} div.lcs.black, #top div.lcs.black.{name} { background: {black}; }'
2012-06-19 15:40:49 -06:00
whitePattern = 'body.{name} #GameBoard td.whiteSquare, body.{name} #GameBoard td.highlightWhiteSquare, body.{name} div.lcs.white, #top div.lcs.white.{name}, body.{name} div.lichess_board { background: {white}; }'
for name in themes:
def formatCss(pattern):
return pattern.replace('{name}', name).replace('{white}', themes[name][0]).replace('{black}', themes[name][1])
2020-06-23 01:13:50 -06:00
print(formatCss(whitePattern))
print(formatCss(blackPattern))