Dynamically generating rounded corners in Java

January 7, 2007

I was looking at re-skinning a sporting team website that I had recently created, and really liked the look of the new rounded corners that grace so many websites. There are two main techniques that are used to achieve that look:

  1. Having a number of 1×1 pixel divs that shape the corners
  2. Having some rounded corner images

I don’t really like the first technique because it seems so inefficient (not to mention that it reminds me of the 1×1-pixel fillers of the 90’s), and the second wasn’t able to be used for my purposes because each team on my website can pick their own colour scheme from the full 24-bit RGB colour space (and I didn’t want to have to create 16777216 different corner combinations). So, what to do?
Read the rest of this entry »