Thank you. Extract by mask looks promising, but I do not need a raster map as an output. Essentially, my raster layer is a colour-coded soil map. What I want in the end is an extra column in the attribute table for the second layer, that would show the colour per each polygon. In those cases where the polygon contains areas with different colours, I'd like to get the colour that covers larger area. I can do this manually, but it's time consuming. I wonder if there is a way to automate this work.