mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples/times_table: header color const
This commit is contained in:
parent
00ce93d282
commit
257c21745a
@ -9,6 +9,7 @@ const (
|
|||||||
N = MAX - MIN + 1
|
N = MAX - MIN + 1
|
||||||
CELL_SIZE = WIN_SIZE / N
|
CELL_SIZE = WIN_SIZE / N
|
||||||
TEXT_CFG = gx.TextCfg { color: gx.BLACK, size: FONT_SIZE }
|
TEXT_CFG = gx.TextCfg { color: gx.BLACK, size: FONT_SIZE }
|
||||||
|
HEADER_COLOR = gx.rgb(240, 240, 240)
|
||||||
)
|
)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@ -32,11 +33,11 @@ fn draw() {
|
|||||||
x := CELL_SIZE * (j - MIN)
|
x := CELL_SIZE * (j - MIN)
|
||||||
// Horizontal header
|
// Horizontal header
|
||||||
if i == MIN {
|
if i == MIN {
|
||||||
gx.draw_rect(x, y, CELL_SIZE, CELL_SIZE, gx.rgb(240, 240, 240))
|
gx.draw_rect(x, y, CELL_SIZE, CELL_SIZE, HEADER_COLOR)
|
||||||
}
|
}
|
||||||
// Vertical header
|
// Vertical header
|
||||||
if j == MIN {
|
if j == MIN {
|
||||||
gx.draw_rect(x, y, CELL_SIZE, CELL_SIZE, gx.rgb(240, 240, 240))
|
gx.draw_rect(x, y, CELL_SIZE, CELL_SIZE, HEADER_COLOR)
|
||||||
}
|
}
|
||||||
// Draw the result
|
// Draw the result
|
||||||
if !(i == MIN && j == MIN) {
|
if !(i == MIN && j == MIN) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user