VexIQ Code - Return type/value for Color.colorname()?

tl;dr - What is the return type/value for Color.colorname?

I’m trying to display the color being sensed by the color sensor on the brain screen. I’m trying something like

Brain.Screen.print(Color3.colorname());

but I’m getting the message "no matching member function for call to 'print’, which I’m assuming means that there is no signature for this type of parameter.

I tried assigning the return value to a string variable, but it’s not doing that, either. Is there any chance the ‘colorname’ has a string return function?

TIA

return type is vex::colorType, it has the following values

colorType
    enum class colorType {
      none,
      red,
      green,
      blue,
      white,
      yellow,
      orange,
      purple, 
      cyan,
      
      red_violet,
      violet,
      blue_violet,
      blue_green,
      yellow_green,
      yellow_orange,
      red_orange,
      
      black,
      transparent
    }

you would need to write your own function to print as a string.

6 Likes

Now, in the spirit of teaching me to fish, is this documented somewhere that I missed? The help within the app is nice, but didn’t have what I sought.

I realized later that I could have just built a blocks program and converted it to c++ to see how it was done, but that seems like reverse-engineering when I don’t really want to do it that way.

6 Likes

I don’t think you missed anything. Part of the reason that VEXcode 2.0 is currently available as a preview is because documentation and examples are incomplete.

6 Likes