1 require 'plugins/plugin'
2 require 'plugins/background'
4 class DefaultBackground
8 plugin :name => 'Default',
10 :keywords => %w(chess)
13 @squares = opts[:board_size] || opts[:game].size
17 Qt::Image.painted(Qt::Point.new(size.x * @squares.x, size.y * @squares.y)) do |p|
18 (0...@squares.x).each do |x|
19 (0...@squares.y).each do |y|
20 rect = Qt::RectF.new(size.x * x, size.y * y, size.x, size.y)
21 color = if (x + y) % 2 == 0
22 Qt::Color.new(0x6b, 0x82, 0x9c)
24 Qt::Color.new(0xb8, 0xc0, 0xc0)
26 p.fill_rect(rect, Qt::Brush.new(color))