@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));
}
BorderDrawableTest.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:ucar-weex-core
作者:
评论列表
文章目录