This was wrong because the bug is that LyX adds color commands to the preamble when using a framed note: \definecolor{shadecolor}{rgb}{1,0,0}
So you mean a frame note does not need this \definecolor? If so, requiring color is wrong and please revert my changes when you fix it. Bo