如何RGB INT值转换为串色 [英] How to convert RGB int values to string color

查看:134
本文介绍了如何RGB INT值转换为串色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何将3个int的山谷 R,G,B 成串色(十六进制值)在C#

解决方案

  INT红色= 255;
INT绿色= 255;
INT蓝色= 255;

串hexColor =#+ red.ToString(X)+ green.ToString(X)+ blue.ToString(X);
 

Can anyone tell me how to convert three int vales r, g, b into a string color(hexa value) in C#

解决方案

int red = 255;
int green = 255;
int blue = 255;

string hexColor = "#" + red.ToString("X") + green.ToString("X") + blue.ToString("X");

这篇关于如何RGB INT值转换为串色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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