Skip to content
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

What is the purpose of the numerical color values? #37

Closed
clbarnes opened this issue Mar 23, 2024 · 6 comments
Closed

What is the purpose of the numerical color values? #37

clbarnes opened this issue Mar 23, 2024 · 6 comments

Comments

@clbarnes
Copy link

clbarnes commented Mar 23, 2024

The spec states that the color field expects a string. Does that mean that preset colors should be given as e.g. "red"? If so, what is the need for the numbers they each map to?

@kepano
Copy link
Collaborator

kepano commented Mar 23, 2024

This is explained in the spec. The preset colors exist so that applications can use color values that match their brand or color scheme, i.e. different apps may have a different default red

Specific values for the preset colors are intentionally not defined so that applications can tailor the presets to their specific brand colors or color scheme.

@kepano kepano closed this as completed Mar 23, 2024
@clbarnes
Copy link
Author

clbarnes commented Mar 23, 2024

Sorry if there was misunderstanding - this question is not about the value of preset colors. It is, as stated in the question, about numerical values for those presets. What is the purpose of the numbers associated with those presets? The spec says that the field expects a string. So is the correct thing to do to specify "red"? In what way, then, is the preset red associated with the number 1? I'm not talking about hex-encoded RGB values for the presets, I'm talking about the integer mappings given in the spec.

@kepano
Copy link
Collaborator

kepano commented Mar 23, 2024

You can see an example in the sample

"color":"6"

@clbarnes
Copy link
Author

OK - can this be un-marked as completed until the spec clarifies that?

@kepano
Copy link
Collaborator

kepano commented Mar 23, 2024

The spec currently states that colors are strings and that there are six numbered presets. Do you have a suggestion about how to make this more clear?

@clbarnes
Copy link
Author

For maximum informative-ness, maybe something like

Color values MUST be represented by strings. The string MAY represent either be RGB values encoded as an octothorpe followed by 3 upper-cased hexadecimal pairs (e.g. "#FF0000"), or an integer representing a preset color according to the table below (e.g. "1"). The exact color of each preset is left up to implementors, who MAY apply their own color scheme.

but my understanding would have been helped greatly simply by including the double quotes in the values in the table, like

- `"1"` red
- `"2"` orange
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants