Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
35
Task/Colour-bars-Display/Wren/colour-bars-display.wren
Normal file
35
Task/Colour-bars-Display/Wren/colour-bars-display.wren
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import "graphics" for Canvas, Color
|
||||
import "dome" for Window
|
||||
|
||||
class Game {
|
||||
static init() {
|
||||
Window.title = "Color bars"
|
||||
__width = 400
|
||||
__height = 400
|
||||
Canvas.resize(__width, __height)
|
||||
Window.resize(__width, __height)
|
||||
var colors = [
|
||||
Color.hex("000000"), // black
|
||||
Color.hex("FF0000"), // red
|
||||
Color.hex("00FF00"), // green
|
||||
Color.hex("0000FF"), // blue
|
||||
Color.hex("FF00FF"), // magenta
|
||||
Color.hex("00FFFF"), // cyan
|
||||
Color.hex("FFFF00"), // yellow
|
||||
Color.hex("FFFFFF") // white
|
||||
]
|
||||
drawBars(colors)
|
||||
}
|
||||
|
||||
static drawBars(colors) {
|
||||
var w = __width / colors.count
|
||||
var h = __height
|
||||
for (i in 0...colors.count) {
|
||||
Canvas.rectfill(w*i, 0, w, h, colors[i])
|
||||
}
|
||||
}
|
||||
|
||||
static update() {}
|
||||
|
||||
static draw(dt) {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue