Skip to content

[Validator] Add RgbColor constraint and validator #35736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

przemyslaw-bogusz
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
License MIT
Doc PR TODO

Following the idea for the HexColor constraint (#35626), I hereby propose the RgbColor constraint, which validates against rgb() and rgba() functions.

@przemyslaw-bogusz
Copy link
Contributor Author

Fabbot indicates a typo in the Polish translation of validation errors (validators.pl.xlf), but there is no typo. The English word address is adres in Polish (with a single d and a single s).

[new class() {
public function __toString()
{
return 'rgb(0,0,0) ';
Copy link
Contributor

Choose a reason for hiding this comment

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

How can this be part of invalid and valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Valid has 'rgb(0,0,0)' and invalid 'rgb(0,0,0) ' (with extra space at the end).

@nicolas-grekas
Copy link
Member

Before spending much time on this feature, I would kindly ask we confirm there is a real world use case for it. Will anyone actually use it?

@przemyslaw-bogusz
Copy link
Contributor Author

Before spending much time on this feature, I would kindly ask we confirm there is a real world use case for it. Will anyone actually use it?

There was at least one request for it in the HexColor constraint PR.

@nicolas-grekas nicolas-grekas added this to the next milestone Feb 18, 2020
@przemyslaw-bogusz
Copy link
Contributor Author

I'm closing this one in favor of other ideas.

@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants