I hope everyone is having a relaxing winter break. I have a small question regarding the smart dashboard, more specifically the text inputted into it. I would like to know, if possible, how to change the text color to support a black background of some sort. I’m relatively new to the Smart Dashboard, being the first year we are implementing it with our robot so I’m unsure if this is a beginner type question or what not; however, I was wondering the possibility of this. Mind you this is not a mandatory issue, as it only serves to be ascetically pleasing in the driver station. The only work around I’ve found is to input a string of some sort
SmartDashboard.putString(" ", " ");
to get that white box background; however if there is a way to change the text, that would be most preferable.
Here’s an image to what I am talking about if I’m not making much sense.
(Note the right half of label being covered by a black background)
TL;DR I want to change the default text color of label and the commands.
There is no builtin way to do it AFAIK, but its not hard to write an extension that adds that a new property for color.
An extension is simply a jar file that contains classes that extend from “Widget” and is in an “extensions” directory next to “SmartDashboard.jar”. I’ll try to write one to show you what I mean.
Ok, here’s an example for you to work off of. Its a label with a new property that sets the text color. If you uncomment the commented lines, it allows you to set the background color too. The zip contains the compiled jar and the source code.
I hope this helps. There isn’t that much documentation for the internals of the SmartDashboard, but if you look through the source, its not that hard to understand.