转换成十六进制颜色字符串颜色? [英] Convert HEX color string to Color?
本文介绍了转换成十六进制颜色字符串颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个颜色为后续的格式 0xAABBCC
为字符串
。
我需要将其转换成颜色
,但好像没有这样的方法,以及所有可用的返回整数
结果,这似乎与颜色
目标不符;
I have a color into the follow format 0xAABBCC
as String
.
I need to convert it into Color
, but seems like there is not such method, and all available is returning Integer
results, which seems incompatible with Color
object;
- 如何创建
颜色
在上述格式从给定的HEX
string类的实例?
- How to create instance of
Color
class from givenHEX
string in the format described above ?
推荐答案
使用 Color.parseColor(#AABBCC);
这篇关于转换成十六进制颜色字符串颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文