Added two more hex string formats to the HexDigitFormatter

This commit is contained in:
tudnai 2022-11-19 14:06:24 -08:00
parent 97ce58420e
commit f2a36f9e33
1 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,12 @@ class HexDigitFormatter: Formatter {
if string.starts(with: "#") {
hexValue = String(string.dropFirst()).uppercased()
}
else if string.starts(with: "%") {
hexValue = String(string.dropFirst()).uppercased()
}
else if string.starts(with: "$") {
hexValue = String(string.dropFirst()).uppercased()
}
else if string.starts(with: "0x") {
hexValue = String(string.dropFirst(2)).uppercased()
}