Use simplified argument list parser

This commit is contained in:
Sven Weidauer 2021-01-01 15:17:50 +01:00
parent 75a3bc265d
commit 04943d8f63

View file

@ -19,11 +19,11 @@ extension Scanner {
}
}
if string("rgba"), string("("), let components = commaSeparated(), components.count == 4, string(")") {
if string("rgba"), let components = argumentList(4) {
return Color(components)
}
if string("rgb"), string("("), let components = commaSeparated(), components.count == 3, string(")") {
if string("rgb"), let components = argumentList(3) {
return Color(components)
}