diff --git a/mozilla/layout/base/nsCSSColorUtils.cpp b/mozilla/layout/base/nsCSSColorUtils.cpp index d177f197e85..5a41dda6452 100644 --- a/mozilla/layout/base/nsCSSColorUtils.cpp +++ b/mozilla/layout/base/nsCSSColorUtils.cpp @@ -197,130 +197,6 @@ int NS_GetBrightness(PRUint8 aRed, PRUint8 aGreen, PRUint8 aBlue) (luminosity * LUMINOSITY_FACTOR)) / 100; } -nscolor NS_BrightenColor(nscolor inColor) -{ - PRIntn r, g, b, max, over; - - r = NS_GET_R(inColor); - g = NS_GET_G(inColor); - b = NS_GET_B(inColor); - - //10% of max color increase across the board - r += 25; - g += 25; - b += 25; - - //figure out which color is largest - if (r > g) - { - if (b > r) - max = b; - else - max = r; - } - else - { - if (b > g) - max = b; - else - max = g; - } - - //if we overflowed on this max color, increase - //other components by the overflow amount - if (max > 255) - { - over = max - 255; - - if (max == r) - { - g += over; - b += over; - } - else if (max == g) - { - r += over; - b += over; - } - else - { - r += over; - g += over; - } - } - - //clamp - if (r > 255) - r = 255; - if (g > 255) - g = 255; - if (b > 255) - b = 255; - - return NS_RGBA(r, g, b, NS_GET_A(inColor)); -} - -nscolor NS_DarkenColor(nscolor inColor) -{ - PRIntn r, g, b, max; - - r = NS_GET_R(inColor); - g = NS_GET_G(inColor); - b = NS_GET_B(inColor); - - //10% of max color decrease across the board - r -= 25; - g -= 25; - b -= 25; - - //figure out which color is largest - if (r > g) - { - if (b > r) - max = b; - else - max = r; - } - else - { - if (b > g) - max = b; - else - max = g; - } - - //if we underflowed on this max color, decrease - //other components by the underflow amount - if (max < 0) - { - if (max == r) - { - g += max; - b += max; - } - else if (max == g) - { - r += max; - b += max; - } - else - { - r += max; - g += max; - } - } - - //clamp - if (r < 0) - r = 0; - if (g < 0) - g = 0; - if (b < 0) - b = 0; - - return NS_RGBA(r, g, b, NS_GET_A(inColor)); -} - // Function to convert RGB color space into the HSV colorspace // Hue is the primary color defined from 0 to 359 degrees // Saturation is defined from 0 to 255. The higher the number.. the deeper the color diff --git a/mozilla/layout/base/nsCSSColorUtils.h b/mozilla/layout/base/nsCSSColorUtils.h index f7502b1b4ec..1a9dfccc274 100644 --- a/mozilla/layout/base/nsCSSColorUtils.h +++ b/mozilla/layout/base/nsCSSColorUtils.h @@ -51,14 +51,6 @@ void NS_GetSpecial3DColors(nscolor aResult[2], nscolor aBackgroundColor, nscolor aBorderColor); -// Special method to brighten a Color and have it shift to white when -// fully saturated. -nscolor NS_BrightenColor(nscolor inColor); - -// Special method to darken a Color and have it shift to black when -// darkest component underflows -nscolor NS_DarkenColor(nscolor inColor); - // Determins brightness for a specific color int NS_GetBrightness(PRUint8 aRed, PRUint8 aGreen, PRUint8 aBlue); diff --git a/mozilla/layout/html/style/src/nsCSSColorUtils.cpp b/mozilla/layout/html/style/src/nsCSSColorUtils.cpp index d177f197e85..5a41dda6452 100644 --- a/mozilla/layout/html/style/src/nsCSSColorUtils.cpp +++ b/mozilla/layout/html/style/src/nsCSSColorUtils.cpp @@ -197,130 +197,6 @@ int NS_GetBrightness(PRUint8 aRed, PRUint8 aGreen, PRUint8 aBlue) (luminosity * LUMINOSITY_FACTOR)) / 100; } -nscolor NS_BrightenColor(nscolor inColor) -{ - PRIntn r, g, b, max, over; - - r = NS_GET_R(inColor); - g = NS_GET_G(inColor); - b = NS_GET_B(inColor); - - //10% of max color increase across the board - r += 25; - g += 25; - b += 25; - - //figure out which color is largest - if (r > g) - { - if (b > r) - max = b; - else - max = r; - } - else - { - if (b > g) - max = b; - else - max = g; - } - - //if we overflowed on this max color, increase - //other components by the overflow amount - if (max > 255) - { - over = max - 255; - - if (max == r) - { - g += over; - b += over; - } - else if (max == g) - { - r += over; - b += over; - } - else - { - r += over; - g += over; - } - } - - //clamp - if (r > 255) - r = 255; - if (g > 255) - g = 255; - if (b > 255) - b = 255; - - return NS_RGBA(r, g, b, NS_GET_A(inColor)); -} - -nscolor NS_DarkenColor(nscolor inColor) -{ - PRIntn r, g, b, max; - - r = NS_GET_R(inColor); - g = NS_GET_G(inColor); - b = NS_GET_B(inColor); - - //10% of max color decrease across the board - r -= 25; - g -= 25; - b -= 25; - - //figure out which color is largest - if (r > g) - { - if (b > r) - max = b; - else - max = r; - } - else - { - if (b > g) - max = b; - else - max = g; - } - - //if we underflowed on this max color, decrease - //other components by the underflow amount - if (max < 0) - { - if (max == r) - { - g += max; - b += max; - } - else if (max == g) - { - r += max; - b += max; - } - else - { - r += max; - g += max; - } - } - - //clamp - if (r < 0) - r = 0; - if (g < 0) - g = 0; - if (b < 0) - b = 0; - - return NS_RGBA(r, g, b, NS_GET_A(inColor)); -} - // Function to convert RGB color space into the HSV colorspace // Hue is the primary color defined from 0 to 359 degrees // Saturation is defined from 0 to 255. The higher the number.. the deeper the color diff --git a/mozilla/layout/html/style/src/nsCSSColorUtils.h b/mozilla/layout/html/style/src/nsCSSColorUtils.h index f7502b1b4ec..1a9dfccc274 100644 --- a/mozilla/layout/html/style/src/nsCSSColorUtils.h +++ b/mozilla/layout/html/style/src/nsCSSColorUtils.h @@ -51,14 +51,6 @@ void NS_GetSpecial3DColors(nscolor aResult[2], nscolor aBackgroundColor, nscolor aBorderColor); -// Special method to brighten a Color and have it shift to white when -// fully saturated. -nscolor NS_BrightenColor(nscolor inColor); - -// Special method to darken a Color and have it shift to black when -// darkest component underflows -nscolor NS_DarkenColor(nscolor inColor); - // Determins brightness for a specific color int NS_GetBrightness(PRUint8 aRed, PRUint8 aGreen, PRUint8 aBlue);