Skip to content

Conversation

twilligon
Copy link
Contributor

These are common enough (especially on the web) that a new user might try to use a 3-digit hex color such as #f00 (or one with transparency such as #f008). We might as well make this work and save a few seconds of confusion/RTFM.

Also, print the "Invalid color" message if the color string is of an allowed length, but not parseable as a hex color (example: #bruh). No reason to be as lenient as HTML.

These are common enough (especially on the web) that a new user might
try to use a 3-digit hex color such as #f00 (or one with transparency
such as #f008). We might as well make this work and save a few seconds
of confusion/RTFM.
}
return res;

swaylock_log(LOG_DEBUG, "Invalid color %s, defaulting to 0xFFFFFFFF", color);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: this should probably be a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants