1 import("../../Pieces/common.lua")
3 function theme
.background(size
)
4 local dark_square
= Color("#6b829c")
5 local light_square
= Color("#b8c0c0")
8 local i
= Image(size
*2,size
*2)
9 i
:set_paint_over(false);
10 i
:fill_rect(Rect(0,0,size
,size
), light_square
)
11 i
:fill_rect(Rect(size
,0,size
,size
), dark_square
)
12 i
:fill_rect(Rect(0,size
,size
,size
), dark_square
)
13 i
:fill_rect(Rect(size
,size
,size
,size
), light_square
)
17 function addShadow(i
, size
)
18 local s
= i
:create_shadow( size
/6, "#ffffff", Point(0, 0), Point(0, 0) )
19 s
:draw_image(Rect(0, 0, i
.width
, i
.height
), i
)
23 function theme
.border(size
)
24 local b
= math
.floor(size
*2/3);
25 local rb
= math
.floor(b
*2/3);
27 local tr
= Image(b
, b
); tr
:clear(); tr
:draw_svg(Rect(0,b
-rb
,rb
,rb
), "corner.svg"); tr
= addShadow(tr
, size
)
28 local tl
= Image(b
, b
); tl
:set_paint_over(false); tl
:rotate(270); tl
:translate(0,b
); tl
:draw_image(Rect(0,0,b
,b
), tr
)
29 local bl
= Image(b
, b
); bl
:set_paint_over(false); bl
:rotate(180); bl
:translate(b
,b
); bl
:draw_image(Rect(0,0,b
,b
), tr
)
30 local br
= Image(b
, b
); br
:set_paint_over(false); br
:rotate(90); br
:translate(b
,0); br
:draw_image(Rect(0,0,b
,b
), tr
)
31 local t
= Image(s8
, b
); t
:clear(); t
:draw_svg(Rect(0,b
-rb
,s8
,rb
), "bar.svg"); t
= addShadow(t
, size
)
32 local bt
= Image(s8
, b
); bt
:set_paint_over(false); bt
:rotate(180); bt
:translate(s8
,b
); bt
:draw_image(Rect(0,0,s8
,b
), t
)
33 local l
= Image(b
, s8
); l
:set_paint_over(false); l
:rotate(270); l
:translate(0,s8
); l
:draw_image(Rect(0,0,s8
,b
), t
)
34 local r
= Image(b
, s8
); r
:set_paint_over(false); r
:rotate(90); r
:translate(b
,0); r
:draw_image(Rect(0,0,s8
,b
), t
)
36 [Rect(-b
,-b
,b
,b
)] = tl
,
37 [Rect(s8
,-b
,b
,b
)] = tr
,
38 [Rect(-b
,s8
,b
,b
)] = bl
,
39 [Rect(s8
,s8
,b
,b
)] = br
,
40 [Rect(0,-b
,s8
,b
)] = t
,
41 [Rect(0,s8
,s8
,b
)] = bt
,
42 [Rect(-b
,0,b
,s8
)] = l
,
50 --i = Image("Wallpapers/autumn.jpg", false)
51 --i = Image("Wallpapers/winter.jpg", false)
52 --i = Image("Wallpapers/dragonballz.jpg", false)
53 i
= Image("Wallpapers/Bled (nastja).jpg", false)
60 function create_clock(file
)
63 local h
= math
.floor(w
*2/5)
66 i
:draw_svg(Rect(0,0,w
,h
), file
)
67 local s
= i
:create_shadow( size
/6, "#ffffff", Point(math
.floor(size
/2.5), math
.floor(size
/2.5)), Point(0, 0) )
68 s
:draw_image(Rect(math
.floor(size
/5), math
.floor(size
/5), i
.width
, i
.height
), i
)
73 theme
.clock_active_background
= create_clock("active_clock.svg")
74 theme
.clock_inactive_background
= create_clock("inactive_clock.svg")
76 theme
.clock_active_text
= function(size
)
77 return Brush("#000000")
80 theme
.clock_inactive_text
= function(size
)
81 return Brush("#808080")
84 theme
.clock_background_offset
= function(size
)
85 return Point(-math
.floor(size
/5), -math
.floor(size
/5))
88 theme
.clock_height
= function(size
)
89 return math
.floor((size
*ratio
)*2/5);
92 theme
.clock_caption_rect
= function(size
)
94 local h
= math
.floor(w
*2/5)
95 return Rect(w
*0.02, h
*0.2, w
*0.4, h
*0.38)
98 theme
.clock_time_rect
= function(size
)
100 local h
= math
.floor(w
*2/5)
101 return Rect(w
*0.4, h
*0.06, w
*0.58, h
*0.66)
104 theme
.clock_player_rect
= function(size
)
106 local h
= math
.floor(w
*2/5)
107 return Rect(w
*0.14, h
*0.68, w
*0.69, h
*0.28)
110 theme
.validmove
= fromColor("#cd9eee")
111 theme
.highlighting
= fromPixmap("square_last.png")
112 theme
.premove
= fromPixmap("square_premove.png")
113 theme
.selection
= fromPixmap("square_select.png")
116 description
= "Default squares"
117 variants
= { "Chess[default]", "Shogi", "XiangQi" }