I have a dijit Listbox with several items inside. Currently, the items inside the list box can only be plain text. The widget doesn't allow me to add icons or CSS properties. As a workaround, I am using Javascript codes to create colored square shapes next to the text of each item.
const items = [{
label: '\uD83D\uDFE5 ' + 'Overflow',
}, {
label: '\uD83D\uDFE8 ' + 'Underflow',
}, {
label: '\uD83D\uDFE6 ' + 'Precision,
}];
I got the standard JS codes above from the internet. But, for consistency with other indicators in our app, I want slightly different versions of these colors above, and I am unsure how to get the JS code for them.
How would I translate the following colors into a colored square shape using JS character codes? And is there a better alternative to add these colored shapes next to the text?
red - rgb(226, 61, 45)
blue - rgb(135,206,235)
Yellow - rgb(241, 181, 28)
Thanks