小编Alp*_*lan的帖子

如何在 Android 中将 Int 值转换为 COLOR(使用 Kotlin 或 Java)?

我搜索了很多但找不到解决方案。

从 API 中,它返回一个 Int 作为颜色值 2813300。这是 Green LiNK to COLOR的色调

我尝试在我的项目中使用此 Int 作为颜色,但无法将其转换为 android.graphics.Color。

当我尝试使用 int 时,它不起作用。

如何将这些数字转换为颜色?

例子:

红色 = 16711936(链接

绿色 = 2813300(链接

graphics android decimal colors kotlin

0
推荐指数
1
解决办法
6125
查看次数

标签 统计

android ×1

colors ×1

decimal ×1

graphics ×1

kotlin ×1