Skip to content

Commit

Permalink
colorstuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Mosley authored and Bart Mosley committed Nov 7, 2011
1 parent 63e4fbf commit 86a972f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions recipes/colorstuff.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ def color_hsv_rgb(h, s, v):

return None

tests_good = ["#FFF", "#FFFFFF", "FFF", "FFFFFF", "#003333"]
tests_bad = ["#GGG", "00H", "A", "FFF0", "GFGFGF", "FFFFFF00"]

print("test valid codes:")
for tst in tests_good:
print tst, color_html_rgb(tst)

print("\ntest invalid codes:")
for tst in tests_bad:
print tst, color_html_rgb(tst)
if __name__ == "__main__":

tests_good = ["#FFF", "#FFFFFF", "FFF", "FFFFFF", "#003333"]
tests_bad = ["#GGG", "00H", "A", "FFF0", "GFGFGF", "FFFFFF00"]

print("test valid codes:")
for tst in tests_good:
print tst, color_html_rgb(tst)

print("\ntest invalid codes:")
for tst in tests_bad:
print tst, color_html_rgb(tst)

0 comments on commit 86a972f

Please sign in to comment.