That idea is close, but with the exception that other colors can’t be in between rows or columns of that color. So in Level 14, the greens on the right are separated vertically by two blues. That is invalid. You’ll need to re-arrange the greens so no other colors are in between them.
This is why, when looking at your solution to Level 15, it should be valid.