对于那些在计算机图形学中非常了解XNA和颜色理论的人,我有一个简短的问题。我正在制作一个瓷砖游戏(有点像Terraria),我想知道如何将每个瓷砖的照明应用到场景中。彩色照明是这个游戏必须的,现在我有4个2D字节数组,存储整体的光和3种不同的颜色数量。当绘制瓷砖时,它采用特定瓷砖的纹理,但我如何根据3个颜色值和整体照明在相同的瓷砖上应用颜色?
现在,这是我的颜色生成函数:
public Color GetColorAt(int x, int y)
{
byte r = _rMap[x, y]; //Red light
byte g = _gMap[x, y]; //Green
我在这里看到了很多关于改变TextView在ListView中的背景颜色的问题/答案,但在我的例子中,它们似乎都不起作用。
在我的“BaseAdapter”类中有GetView方法:
String status = item.getStatus().trim();
int backgroundColor = 0;
if (status.trim().equals("S")) {
backgroundColor = R.color.corSeparada;
}
if (status.trim().equals("F")) {
我试图根据列表视图中的文本更改每个单元格的颜色。以下是我当前填充列表视图的方式:
DBHelper db = new DBHelper(this);
List<HiveEquipment> heList = db.getEquipmentForHive(currentHiveId);
final ArrayAdapter<HiveEquipment> dataAdapter = new ArrayAdapter<HiveEquipment>(this,
android.R.layout.simple_list_