mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 05:53:22 +00:00
colors: Reuse the HexDigits constant in strutils (#16065)
Co-authored-by: Xuecong Liao <xliao@flexport.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user