Array with duplicate keys

Is there any method for creating lists with duplicate keys?

I have a color picker (circular menu) that let’s me select different colors. The text-color and background-color are identical, since i don’t need to see the color name printed when the picker is opened (and it’s also a space issue since the picker cant be gigantic).

However, when the picker (circle menu) is closed I want to only show a specific icon, no matter what color was selected, when the picker is closed, for instance the icon: ^palette

However arrays cant have duplicate array keys (for obvious reasons) - which means all items cant have the key set to: “^palette”. Instead i must add an incrementing number or some other differenting identifier that makes the array key unique. But that identifier will then also be printed next to the icon, after the menu is closed =\

Is there any method to circumvent this, built into the system?

You could ignore the menu’s label and put a text widget over it as a replacement. Interactions are ignored on text widgets so you’ll still be able to open the menu (except when the editor is enabled, because non-interactable widgets must remain editable) .

Good tip, thanks!

However, i ended up using this solution:

  • #2c3a4b is menu button background color to make text invisible
  • div.icon {display:none;} is to hide original arrow icon indicating that it’s a menu
  • div.text > i {color:#fff;} - to change text-color inside tag (that contains new icon)

div.icon {display:none;}
div.text {font-size:150%;color:#2c3a4b;}
div.text > i {color:#fff;}