public class BackgroundColorAnalyzer
extends java.lang.Object
Constructor and Description |
---|
BackgroundColorAnalyzer(Area root)
Constructs a color analyzer.
|
Modifier and Type | Method and Description |
---|---|
double |
getColorPercentage(Area area)
Obtains the average percentage of the total area that has the same background color as the given area.
|
double |
getColorPercentage(java.awt.Color color)
Obtains the percentage of the area that has the given color.
|
static java.awt.Color |
getEffectiveBackgroundColor(Area area)
Computes the effective (visible) background color of an area considering
transparency and parent areas.
|
public BackgroundColorAnalyzer(Area root)
root
- public double getColorPercentage(java.awt.Color color)
color
- the color to be tested.public double getColorPercentage(Area area)
area
- the area whose background should be compared.public static java.awt.Color getEffectiveBackgroundColor(Area area)
area
- The area