I added another test panel and I think I figured it out.
const Panel10 = Content.getComponent("Panel10");
const colorConst10 = 0xffddbbaa;
Panel10.setPaintRoutine(function(g)
{
var vec4 = Colours.toVec4(colorConst10);
var c = Colours.fromVec4(vec4);
Console.print(colorConst10); //4292721578
Console.print(vec4); //[Array]
Console.print(trace(vec4)); //[0.8666666746139526,0.7333333492279053,0.6666666865348816,1.0]
Console.print(c); //-2245718
g.setColour(c);
g.fillRect([0,0,20,20]);
});
The thing that I was getting wrong this whole time was that the vec4 array contains normalized RGB components. I thought the problem was that the colors were out of scope or something.