mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
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:
parent
0d39284466
commit
02e7316517
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user