b=135208 r=kmcclusk@netscape.com sr=attinasi a=asa Fixed printing of color text when we dont

have a background.
This commit is contained in:
dcone%netscape.com 2002-04-12 14:30:00 +00:00
parent 0d39284466
commit 02e7316517
2 changed files with 22 additions and 30 deletions

View File

@ -1390,30 +1390,26 @@ PRIntn whichSide=0;
}
}
nscolor
nscolor
nsCSSRendering::TransformColor(nscolor aMapColor,PRBool aNoBackGround)
{
PRInt32 brightness;
nscolor newcolor;
PRUint16 hue,sat,value;
nscolor newcolor;
newcolor = aMapColor;
if (PR_TRUE == aNoBackGround){
// convert the RBG to a brightness value (HSV scale)
brightness = NS_GetBrightness(NS_GET_R(aMapColor),NS_GET_G(aMapColor),NS_GET_B(aMapColor));
if(brightness > 64){
newcolor = NS_RGB(64,64,64);
// convert the RBG to HSV so we can get the lightness (which is the v)
RGB2HSV(newcolor,hue,sat,value);
// if the value is lighter than 192, bring it back down.
if(value > 192) {
value = 192;
// convert this color back into the RGB color space.
HSV2RGB(newcolor,hue,sat,value);
}
}
return newcolor;
return newcolor;
}
// method GetBGColorForHTMLElement
//
// Now here's a *fun* hack: Nav4 uses the BODY element's background color for the

View File

@ -1390,30 +1390,26 @@ PRIntn whichSide=0;
}
}
nscolor
nscolor
nsCSSRendering::TransformColor(nscolor aMapColor,PRBool aNoBackGround)
{
PRInt32 brightness;
nscolor newcolor;
PRUint16 hue,sat,value;
nscolor newcolor;
newcolor = aMapColor;
if (PR_TRUE == aNoBackGround){
// convert the RBG to a brightness value (HSV scale)
brightness = NS_GetBrightness(NS_GET_R(aMapColor),NS_GET_G(aMapColor),NS_GET_B(aMapColor));
if(brightness > 64){
newcolor = NS_RGB(64,64,64);
// convert the RBG to HSV so we can get the lightness (which is the v)
RGB2HSV(newcolor,hue,sat,value);
// if the value is lighter than 192, bring it back down.
if(value > 192) {
value = 192;
// convert this color back into the RGB color space.
HSV2RGB(newcolor,hue,sat,value);
}
}
return newcolor;
return newcolor;
}
// method GetBGColorForHTMLElement
//
// Now here's a *fun* hack: Nav4 uses the BODY element's background color for the