Package org.apache.poi.sl.draw
Class DrawPaint
- java.lang.Object
-
- org.apache.poi.sl.draw.DrawPaint
-
public class DrawPaint extends java.lang.ObjectThis class handles color transformations.- See Also:
- HSL code taken from Java Tips Weblog
-
-
Constructor Summary
Constructors Constructor Description DrawPaint(PlaceableShape<?,?> shape)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.awt.ColorapplyColorTransform(ColorStyle color)Convert color transformations inColorStyleto aColorinstancestatic PaintStyle.SolidPaintcreateSolidPaint(java.awt.Color color)static PaintStyle.SolidPaintcreateSolidPaint(ColorStyle color)java.awt.PaintgetPaint(java.awt.Graphics2D graphics, PaintStyle paint)java.awt.PaintgetPaint(java.awt.Graphics2D graphics, PaintStyle paint, PaintStyle.PaintModifier modifier)static java.awt.ColorHSL2RGB(double h, double s, double l, double alpha)Convert HSL values to a RGB Color.static floatlin2srgb(int linRGB)Convert linear RGB [0..100000] to sRGB float component [0..1]static intsrgb2lin(float sRGB)Convert sRGB float component [0..1] from sRGB to linear RGB [0..100000]
-
-
-
Constructor Detail
-
DrawPaint
public DrawPaint(PlaceableShape<?,?> shape)
-
-
Method Detail
-
createSolidPaint
public static PaintStyle.SolidPaint createSolidPaint(java.awt.Color color)
-
createSolidPaint
public static PaintStyle.SolidPaint createSolidPaint(ColorStyle color)
-
getPaint
public java.awt.Paint getPaint(java.awt.Graphics2D graphics, PaintStyle paint)
-
getPaint
public java.awt.Paint getPaint(java.awt.Graphics2D graphics, PaintStyle paint, PaintStyle.PaintModifier modifier)
-
applyColorTransform
public static java.awt.Color applyColorTransform(ColorStyle color)
Convert color transformations inColorStyleto aColorinstance
-
HSL2RGB
public static java.awt.Color HSL2RGB(double h, double s, double l, double alpha)Convert HSL values to a RGB Color.- Parameters:
h- Hue is specified as degrees in the range 0 - 360.s- Saturation is specified as a percentage in the range 1 - 100.l- Luminance is specified as a percentage in the range 1 - 100.alpha- the alpha value between 0 - 1- Returns:
- the RGB Color object
-
srgb2lin
public static int srgb2lin(float sRGB)
Convert sRGB float component [0..1] from sRGB to linear RGB [0..100000]- See Also:
Color.getRGBColorComponents(float[])
-
lin2srgb
public static float lin2srgb(int linRGB)
Convert linear RGB [0..100000] to sRGB float component [0..1]- See Also:
Color.getRGBColorComponents(float[])
-
-