colors: Reuse the HexDigits constant in strutils (#16065)
Co-authored-by: Xuecong Liao <xliao@flexport.com>
This commit is contained in:
parent
7815ed69d4
commit
81a03238ed
1 changed files with 1 additions and 1 deletions
|
|
@ -475,7 +475,7 @@ proc isColor*(name: string): bool =
|
|||
if name.len == 0: return false
|
||||
if name[0] == '#':
|
||||
for i in 1 .. name.len-1:
|
||||
if name[i] notin {'0'..'9', 'a'..'f', 'A'..'F'}: return false
|
||||
if name[i] notin HexDigits: return false
|
||||
result = true
|
||||
else:
|
||||
result = binarySearch(colorNames, name, colorNameCmp) >= 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue