Android 根据color id 获取颜色16进制值
来源:互联网 发布:仓储物流软件系统 编辑:程序博客网 时间:2024/06/05 17:31
public static String changeColor(int id){
StringBuffer stringBuffer = new StringBuffer();
int color = CommentManager.getInstance().getContext().getResources().getColor(id);
stringBuffer.append("#");
stringBuffer.append(Integer.toHexString(Color.alpha(color)));
stringBuffer.append(Integer.toHexString(Color.red(color)));
stringBuffer.append(Integer.toHexString(Color.green(color)));
stringBuffer.append(Integer.toHexString(Color.blue(color)));
return stringBuffer.toString();
}
StringBuffer stringBuffer = new StringBuffer();
int color = CommentManager.getInstance().getContext().getResources().getColor(id);
stringBuffer.append("#");
stringBuffer.append(Integer.toHexString(Color.alpha(color)));
stringBuffer.append(Integer.toHexString(Color.red(color)));
stringBuffer.append(Integer.toHexString(Color.green(color)));
stringBuffer.append(Integer.toHexString(Color.blue(color)));
return stringBuffer.toString();
}
阅读全文
0 0
- Android 根据color id 获取颜色16进制值
- Android 代码中获取颜色 Color
- android 根据资源id 获取 资源名称
- android 根据文件名获取图片资源id
- Android根据图片资源ID获取文件名
- Android 根据字符串获取资源id
- 。。iOS 根据美工给的16进制 得到颜色Color
- android 颜色(color)
- Android 颜色Color
- Android 颜色Color
- android color.xml 颜色
- Android 颜色Color
- 根据id获取bostype
- android webview获取html代码和根据id获取value
- 根据颜色获取图片
- android根据id获取string.xml等静态资源
- Android 根据drawable中图片的名称获取ID
- Android:根据图片的名称获取对应的资源id
- 计算机视觉学习及Google的autom的NasNet
- 红黑树简要总结
- 11.03 CSS的基本使用
- java 包装类之Integer -Character
- Mysql、Oracle、Hive中查找表、数据库
- Android 根据color id 获取颜色16进制值
- springmvc 完成文件的下载,并指定格式
- 西游项目漫谈
- UIToolBar iOS 11适配问题
- C++的学习(战略篇)
- oracle csv文件数据导入以及常见问题
- 新方格取数 解题报告
- 【deeplearning.ai笔记第二课】2.3 学习率衰减(learning rate decay),局部极小值和鞍点
- 输入描述