Add support for shorthand hex colors

This commit is contained in:
Anthony Sottile
2020-03-17 12:37:31 -07:00
parent e77a660029
commit 080f6e1d54
2 changed files with 4 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ from babi.color import Color
('#1e77d3', Color(0x1e, 0x77, 0xd3)),
('white', Color(0xff, 0xff, 0xff)),
('black', Color(0x00, 0x00, 0x00)),
('#ccc', Color(0xcc, 0xcc, 0xcc)),
),
)
def test_color_parse(s, expected):