1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/gx/gx_test.v

14 lines
316 B
V
Raw Normal View History

2020-03-07 06:30:35 +03:00
import gx
fn test_hex() {
// valid colors
color_a := gx.hex(0x6c5ce7)
color_b := gx.rgb(108, 92, 231)
assert color_a.eq(color_b) == true
// doesn't give right value with short hex value
short_color := gx.hex(0xfff)
white_color := gx.rgb(255, 255, 255)
assert short_color.eq(white_color) == false
}