如何在android studio中将3个int rgb值转换为一个int值?

问题描述 投票:0回答:1

我不知道如何将我的3个值(redgreenblue的int值)转换为android的一个颜色int值。

java android colors rgb
1个回答
0
投票

Color(android.graphics.Color)是一个默认的android类。

int myColor = Color.rgb(red, blue, green)
myView.setBackgroundColor(myColor);
© www.soinside.com 2019 - 2024. All rights reserved.