I was doing some coding (on VCS sadly) and I was wondering if there is a way to customize colors on the V5 brain screen. VCS will only let me do certain colors and I was really hoping for a tan color. Is there any way to get that?
The color
type has a constructor that takes RGB colour values. For example, if you want a light grey, you can do Brain.Screen.setFillColor({0xDD, 0xDD, 0xDD})
.
2 Likes
Lots of ways to create colors.
int main() {
// using one of the named colors
Brain.Screen.setFillColor( red );
Brain.Screen.drawRectangle( 10, 10, 30, 40 );
// using web color
Brain.Screen.setFillColor( "#008000" );
Brain.Screen.drawRectangle( 50, 10, 30, 40 );
// using hue
Brain.Screen.setFillColor( 120.0 );
Brain.Screen.drawRectangle( 90, 10, 30, 40 );
// as color instance
vex::color c = vex::color( 0, 30, 200 );
Brain.Screen.setFillColor( c );
Brain.Screen.drawRectangle( 130, 10, 30, 40 );
// a different way to name color
vex::color tan;
tan.web("#D2B48C");
Brain.Screen.setFillColor( tan );
Brain.Screen.drawRectangle( 170, 10, 30, 40 );
while(1) {
// Allow other tasks to run
this_thread::sleep_for(10);
}
}
2 Likes
So, rose is rose, no matter what colorspace you use?
1 Like
Who knows what colorspace the V5 LCD is using, pretty sure itβs not sRGB, what you see is what you get.
3 Likes
I know this is a really old topic, but I wanted to ask, do the hex color codes support having an alpha value? An example would be β#ff0000β for red, and with an alpha value (or a transparency value), you could use β#ff00007fβ to get a halfway transparent red.
1 Like
Yea, six years old. We do not support alpha channel.
3 Likes