转换成十六进制颜色字符串颜色? [英] Convert HEX color string to Color?

查看:118
本文介绍了转换成十六进制颜色字符串颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个颜色为后续的格式 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 given HEX string in the format described above ?

推荐答案

使用 Col​​or.parseColor(#AABBCC);

这篇关于转换成十六进制颜色字符串颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆