editLayer function

Edit a color patch using morphological operations