Hello,
I think you need to use:
/**
* Sets the colors.
*
* colorReleased The color released.
* colorPressed The color pressed.
* borderColorReleased The border color released.
* borderColorPressed The border color pressed.
*/
void setBoxWithBorderColors(const colortype colorReleased, const colortype colorPressed, const colortype borderColorReleased, const colortype borderColorPressed)
{
up = colorReleased;
down = colorPressed;
borderUp = borderColorReleased;
borderDown = borderColorPressed;
handlePressedUpdated();
}
Tip: how did I find it?
Create a flex button and change the background colors.

Go to the ScreenXXXViewBase in "generated" folder and check what was the call corresponding to the color settings:
flexButton1.setBoxWithBorderColors(touchgfx::Color::getColorFromRGB(168, 209, 230), touchgfx::Color::getColorFromRGB(54, 68, 217), touchgfx::Color::getColorFromRGB(255, 255, 255), touchgfx::Color::getColorFromRGB(250, 250, 250));
The two first parameters correspond to the pressed/released background colors.
Hope that helps.