首页 > 解决方案 > 如何在 android studio 中将 3 个 int rgb 值转换为一个 int 颜色值?

问题描述

我不知道如何将我的 3 个值(用于 和 的 int 值redgreen转换blue为 android 的一种颜色 int 值。

标签: javaandroidcolorsrgb

解决方案


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

int myColor = Color.rgb(red, blue, green)
myView.setBackgroundColor(myColor);

推荐阅读