added functionality to support gradient borders/backgrounds and rounded
corners