nsDOMCSSRGBColor *rgb = nsnull;  if (color) { rgb = GetDOMCSSRGBColor(color->mColor); if (!rgb) { delete val;  return NS_ERROR_OUT_OF_MEMORY; }  val->SetColor(rgb);
if(color) { nsAutoString hex; ColorToHex(color->mColor, hex); val->SetString(hex); } else { val->SetString("");
nsComputedDOMStyle::GetColor(nsIFrame *aFrame,                             nsIDOMCSSValue** aValue){  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);  const nsStyleColor* color = nsnull;  GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)color, aFrame);  nsDOMCSSRGBColor *rgb = nsnull;  if (color) {    rgb = GetDOMCSSRGBColor(color->mColor);    if (!rgb) {      delete val;      return NS_ERROR_OUT_OF_MEMORY;    }    val->SetColor(rgb);  }  return CallQueryInterface(val, aValue);}