Merge pull request #1672 from Juneezee/master

lib/color: avoid unnecessary byte/string conversion
This commit is contained in:
Alexander Wang 2023-10-18 11:48:09 -07:00 committed by GitHub
commit 0e8fa7cd8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ import (
var themeColorRegex = regexp.MustCompile(`^(N[1-7]|B[1-6]|AA[245]|AB[45])$`)
func IsThemeColor(colorString string) bool {
return themeColorRegex.Match([]byte(colorString))
return themeColorRegex.MatchString(colorString)
}
func Darken(colorString string) (string, error) {