Klasse ColorProvider
java.lang.Object
io.jenkins.plugins.coverage.metrics.color.ColorProvider
Loads a color palette and provides these colors and operations on them. The colors are provided as a tuple of fill
color and line color, mapped by the id of the fill color.
- Autor:
- Florian Orendi
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic class
Wraps the fill color and the line color that should be used in order to visualize coverage values. -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final ColorProvider.DisplayColors
Default color that is provided if no color is found in order to guarantee a proper colorization. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Color
blendColors
(Color color1, Color color2) Blends two colors.static Color
blendWeightedColors
(Color color1, Color color2, double weight1, double weight2) Blends two colors using weights that have to be greater then zero.static String
colorAsRGBAHex
(Color color, int alpha) Provides the RGBA hex string of the passed color.static String
colorAsRGBHex
(Color color) Provides the RGB hex string of the passed color.boolean
containsColorId
(ColorId colorId) Checks whether the provider containsdisplay colors
for the passed id.getBlendedDisplayColors
(double weightFirst, double weightSecond, ColorId first, ColorId second) Gets the blendeddisplay colors
in dependence of the passed weights for each colors.getDisplayColorsOf
(ColorId colorId) Returns thedisplay colors
for the passed id.
-
Felddetails
-
DEFAULT_COLOR
Default color that is provided if no color is found in order to guarantee a proper colorization.
-
-
Methodendetails
-
blendColors
-
blendWeightedColors
public static Color blendWeightedColors(@NonNull Color color1, @NonNull Color color2, double weight1, double weight2) Blends two colors using weights that have to be greater then zero.- Parameter:
color1
- The first colorcolor2
- The second colorweight1
- The weight of the first colorweight2
- The weight of the second color- Gibt zurück:
- the blended color
-
colorAsRGBAHex
-
colorAsRGBHex
-
getDisplayColorsOf
Returns thedisplay colors
for the passed id.- Parameter:
colorId
- The ID of the fill color- Gibt zurück:
- the display colors or the
default color
if no color has been found
-
containsColorId
Checks whether the provider containsdisplay colors
for the passed id.- Parameter:
colorId
- The color id that should be checked- Gibt zurück:
true
whether the id is available, elsefalse
-
getBlendedDisplayColors
public ColorProvider.DisplayColors getBlendedDisplayColors(double weightFirst, double weightSecond, ColorId first, ColorId second) Gets the blendeddisplay colors
in dependence of the passed weights for each colors.- Parameter:
weightFirst
- The weight of the first colorsweightSecond
- The weight of the second colorsfirst
- The first display colorssecond
- The second display colors- Gibt zurück:
- the blended display colors or the
DEFAULT_COLOR
if one color has not been found
-