@Test
public void testGetOpacity() throws Exception {

  BorderDrawable opaque = new BorderDrawable();
  opaque.setColor(Color.GREEN);
  assertThat(opaque.getOpacity(), is(PixelFormat.OPAQUE));
  BorderDrawable transparent = new BorderDrawable();
  transparent.setColor(WXResourceUtils.getColor("#00ff0000"));
  assertThat(transparent.getOpacity(), is(PixelFormat.TRANSPARENT));
  BorderDrawable half = new BorderDrawable();
  half.setColor(WXResourceUtils.getColor("#aaff0000"));
  assertThat(half.getOpacity(), is(PixelFormat.TRANSLUCENT));
  BorderDrawable changeAlpha = new BorderDrawable();
  changeAlpha.setColor(Color.RED);
  changeAlpha.setAlpha(15);
  assertThat(changeAlpha.getOpacity(), is(PixelFormat.TRANSLUCENT));
}