I'm reading screen output and playing it on an Phidget LED 64 array, which accepts values 0-100.
Is there a more robust way to convert from a color value to an integer? I'm nervous that the R value will not be the actual grayscale value. Is it typical for the number to come out as the inverse? Where can I learn more about color information?
for (int i = 0; i < pixels.length; i++) {
int val = pixels[i] >> 16;
val=256+val;
val=int(map(val,0,255,0,100));
lightLED(i,val);
}
Is there a more robust way to convert from a color value to an integer? I'm nervous that the R value will not be the actual grayscale value. Is it typical for the number to come out as the inverse? Where can I learn more about color information?
for (int i = 0; i < pixels.length; i++) {
int val = pixels[i] >> 16;
val=256+val;
val=int(map(val,0,255,0,100));
lightLED(i,val);
}
1