Skip to content

Conversation

@cbrunschen
Copy link
Contributor

Also uses the Ensoniq VFX family of layouts to show it working, and adds a bit to the documentation.

…ors by hex rgb(a) values.

Also uses the Ensoniq VFX family of layouts to show it working,
as well as documenting it.
@cbrunschen cbrunschen marked this pull request as ready for review November 18, 2025 07:46
@Gurudumps
Copy link

Maybe instead of using the hex word just use # before the number within the quotes like SVG does.
Example in svg would be: stroke="#00ff00" which makes it green.

@cbrunschen
Copy link
Contributor Author

Maybe instead of using the hex word just use # before the number within the quotes like SVG does. Example in svg would be: stroke="#00ff00" which makes it green.

The colour has to be specified as some attribute of the <color> component. Neither of the existing red, green, blue or alpha attributes would be a good choice for that. So, a new attribute is required - I chose to call it hex because that describes what it contains: a hexadecimal version of the colour, much like you'd encounter in SVG or HTML.

In SVG or HTML, the colour is applied through a color or fill or stroke or background attribute on another element. And both HTML and SVG have to be able to handle both named colours such as "white", "black", "teal" etc, and hex colours. So they need a way to differentiate between named and directly specified values, which is where the # mark comes in: it differentiates a hypohetical named colour "fadefa" from the hex colour value "#fadefa".

But here, where we're not looking to handle named colours on an overloaded attribute, we don't need the # to differentiate them. Indeed, if we did want to support named colours, that could then be done with a separate attribute; but really that wouldn't be needed, because named colours can already be very nicely handled by using the existing <param> facility:

<param name="color_background" value="101010" />
<param name="color_text" value="9a9a5a" />
<param name="color_highlight" value="ff4a4a" />

<rect ...>
  <color hex="~color_background~" />
</rect>
<text ...>
  <color hex="~color_text~" /?
</text>

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

Successfully merging this pull request may close these issues.

2 participants