How does the painting tool work?

When I try painting A structure, the painted colour disappears before I can apply it. the structure is already built and is selected when I try to paint on it. hopefully you can help

Unfortunately, we can’t paint buildings that have been built. There’s nothing I know how to do to prevent that.