You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question posed here in Q&A because it's not worthy of submitting an Issue, but the Ideas discussion group doesn't seem to have any traction at this time.
How do you all feel about adding aliases for the non-matching CSS color space ids? For now it's just the 4 ids listed in the title. I have a use for these as Color.prototype.propertyName, and yes, I want them in spite of the fact that they might contain hyphens and can't be used as Color.prototype.property-name. For reference, the set of sub-properties for HTMLElement.style includes all the hyphenated names as well as their camelCase counterparts. I am using variables as Color.prototype[selectElement.value] and I'm displaying the CSS version of the color space ids in my <select>.
Of course there's a workaround, I just thought that since aliases already exist for xyz and maybe other spaces, this would be a low impact change and possibly even desirable to others beyond myself. I don't fully understand how aliases work, so I suppose that's part of my question too. I might be mistaken and the property names are converted to snake_case regardless, so no hyphens. But then still I can snake_case all my CSS ids instead of making exceptions for these four. Asking for hyphenated versions of the properties is likely an entirely different feature.
And yes, I realize that the color space id is srgb, but even Color.js doesn't display color(srgb 0 0 0), it uses rgb(0 0 0). Though I also see that the srgb space's coords are 0-1 and display() uses percentages, not ints 0-255.
I now see that there's a ColorSpace.prototype.cssId property, so the strings already exist in each space, fwiw.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Question posed here in Q&A because it's not worthy of submitting an Issue, but the Ideas discussion group doesn't seem to have any traction at this time.
How do you all feel about adding aliases for the non-matching CSS color space ids? For now it's just the 4 ids listed in the title. I have a use for these as
Color.prototype.propertyName
, and yes, I want them in spite of the fact that they might contain hyphens and can't be used asColor.prototype.property-name
. For reference, the set of sub-properties forHTMLElement.style
includes all the hyphenated names as well as their camelCase counterparts. I am using variables asColor.prototype[selectElement.value]
and I'm displaying the CSS version of the color space ids in my<select>
.Of course there's a workaround, I just thought that since aliases already exist for
xyz
and maybe other spaces, this would be a low impact change and possibly even desirable to others beyond myself. I don't fully understand how aliases work, so I suppose that's part of my question too. I might be mistaken and the property names are converted to snake_case regardless, so no hyphens. But then still I can snake_case all my CSS ids instead of making exceptions for these four. Asking for hyphenated versions of the properties is likely an entirely different feature.And yes, I realize that the color space id is
srgb
, but even Color.js doesn't displaycolor(srgb 0 0 0)
, it usesrgb(0 0 0)
. Though I also see that thesrgb
space'scoords
are 0-1 anddisplay()
uses percentages, not ints 0-255.I now see that there's a
ColorSpace.prototype.cssId
property, so the strings already exist in each space, fwiw.Beta Was this translation helpful? Give feedback.
All reactions