如何将RGB值转换为十六进制值,像阿尔法(0xFFFFFFFF的)? [英] how to convert RGB value to hexadecimal value with alpha like (0xFFFFFFFF)?

查看:2168
本文介绍了如何将RGB值转换为十六进制值,像阿尔法(0xFFFFFFFF的)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有RGB整数值(例如:00255),我想转换成这种格式0XFF0000FF。我用这部分的code,

I have RGB integer value (ex:00255), i want to convert into this format 0XFF0000FF .I used this part of code,

int intColor=00255;
String hexColor = String.format("0x%08X", (0xFFFFFFFF & intColor));

但我得到透明color.please帮我

But i got transparent color.please help me

推荐答案

如果你有一个RGB色白:FFFFFF

If you have an RGB color white : FFFFFF

0X +? + FFFFFF将是最后的格式,其中?是Alpha透明度FF表示完全不透明00表示完全透明

0x + ?? + FFFFFF will be the final format where ?? is the alpha transparency FF means totally opaque 00 means totally transparent

不透明白色:0xFFFFFFFF的

Opaque white :0xFFFFFFFF

透明白色:至0x00FFFFFF

Transparent White : 0x00FFFFFF

这篇关于如何将RGB值转换为十六进制值,像阿尔法(0xFFFFFFFF的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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