https://github.com/aburch/simutrans/blob/823c36faa8cb0de695a238df3817ff48bd1cfe4a/gui/map_frame.cc#L78
As far as you can see the code above, the factory color legend in the minimap dialog seems to be intended to show both the frame and the color bar, but since the frame and the color are the same size, the frame is not shown. (The frame will be covered by the color bar). In other words, if designer doesn't want to show the frame, the code to show the frame is useless, and if want to show the frame, the size of the frame is wrong. I'm not sure which is the intention of the standard developers, so I just report it.
EDIT: Improper word selection by machine translation: border → frame
The grey border seems to have been introduced in r6606, but with the bug already present. Maybe in ancient times there was this grey border? As nobody complained, I will delete that useless code line.
Such grey borders are used in factory list and attraction list. Just not in the map legend for factory entries. What to do? Draw such borders everywhere, where a colored box appears?
I would argue that the attraction and factory list boxes are status boxes and thus different from color boxes.
We have even more status bars, like in stations too, and also with frame/