Have a picture fill the remaining space of the panel

I have a problem with creating UI in Unity. I have a panel, I want to put some square buttons in it. Then, there will surely be some place left - I would like to put another sprite and would like it to take up the whole remaining space. Something like this:


So basically, the green/red bar would take all the space except for the space taken by purple buttons.
Ican achieve such effect easily, by adding vertical layour group to the container, set canvas to scale with resolution and set certain values on buttons and bar using layout element. But, I would love to learn about a way of doing this, that would also work when changing the screen ratio. Right now when I change the resolution from 16:9 to something else, like 4:3, there are gaps at the top and the bottom.

So, setting the Canvas Scaler to match height instead of width fixed that. Then anchoring to the specific edge of the screen did the trick