There's no automatic way to do this in the data layer. You would need to use a JavaScript code extension.
If you are using jQuery, then this code should work:
{code:js}
if (window.jQuery) {
var colors = jQuery("#colors").data("colors");
for (var color in colors) {
if (typeof colors[color] == "string") {
b["color-" + color] = colors[color];
}
}
}
{code}
This will check for jQuery, and then use it to read the
node from the html.
It will then create a data layer variable from each entry. In your example html, it will create two data layer variables: "color-white" and "color-red".
You also need to add the variables in the Data Sources config tab, before you can use them in mappings. They will exist in the data layer but the tags won't know about them until you add them to the list.