Was making progress on wm_core so that the legend is created first and then the colors are taken from that, but I've been interrupted by having to leave the room I'm in.