org.apache.poi.sl.draw

## Class DrawPaint

- java.lang.Object
- - org.apache.poi.sl.draw.DrawPaint

-     public class DrawPaint
      extends java.lang.Object

  This class handles color transformations.
  See Also:
    HSL code taken from Java Tips Weblog

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected PlaceableShape<?,?>` | `shape`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DrawPaint(PlaceableShape<?,?> shape)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.awt.Color` | `applyColorTransform(ColorStyle color)` Convert color transformations in `ColorStyle` to a `Color` instance
    `protected java.awt.Paint` | `createLinearGradientPaint(PaintStyle.GradientPaint fill, java.awt.Graphics2D graphics)`
    `protected java.awt.Paint` | `createPathGradientPaint(PaintStyle.GradientPaint fill, java.awt.Graphics2D graphics)`
    `protected java.awt.Paint` | `createRadialGradientPaint(PaintStyle.GradientPaint fill, java.awt.Graphics2D graphics)`
    `static PaintStyle.SolidPaint` | `createSolidPaint(java.awt.Color color)`
    `static PaintStyle.SolidPaint` | `createSolidPaint(ColorStyle color)`
    `protected java.awt.Paint` | `getGradientPaint(PaintStyle.GradientPaint fill, java.awt.Graphics2D graphics)`
    `java.awt.Paint` | `getPaint(java.awt.Graphics2D graphics, PaintStyle paint)`
    `java.awt.Paint` | `getPaint(java.awt.Graphics2D graphics, PaintStyle paint, PaintStyle.PaintModifier modifier)`
    `protected java.awt.Paint` | `getSolidPaint(PaintStyle.SolidPaint fill, java.awt.Graphics2D graphics, PaintStyle.PaintModifier modifier)`
    `protected java.awt.Paint` | `getTexturePaint(PaintStyle.TexturePaint fill, java.awt.Graphics2D graphics)`
    `static java.awt.Color` | `HSL2RGB(double h, double s, double l, double alpha)` Convert HSL values to a RGB Color.
    `static float` | `lin2srgb(int linRGB)` Convert linear RGB [0..100000] to sRGB float component [0..1]
    `static double[]` | `RGB2HSL(java.awt.Color color)` Convert a RGB Color to it corresponding HSL values.
    `static int` | `srgb2lin(float sRGB)` Convert sRGB float component [0..1] from sRGB to linear RGB [0..100000]

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### shape

          protected PlaceableShape<?,?> shape

  - ### 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)

    - #### getSolidPaint

          protected java.awt.Paint getSolidPaint(PaintStyle.SolidPaint fill,
                                                 java.awt.Graphics2D graphics,
                                                 PaintStyle.PaintModifier modifier)

    - #### getGradientPaint

          protected java.awt.Paint getGradientPaint(PaintStyle.GradientPaint fill,
                                                    java.awt.Graphics2D graphics)

    - #### getTexturePaint

          protected java.awt.Paint getTexturePaint(PaintStyle.TexturePaint fill,
                                                   java.awt.Graphics2D graphics)

    - #### applyColorTransform

          public static java.awt.Color applyColorTransform(ColorStyle color)

      Convert color transformations in `ColorStyle` to a `Color` instance
      See Also:
        Using Office Open XML to Customize Document Formatting in the 2007 Office System, saturation modulation (satMod), Office Open XML satMod results in more than 100% saturation

    - #### createLinearGradientPaint

          protected java.awt.Paint createLinearGradientPaint(PaintStyle.GradientPaint fill,
                                                             java.awt.Graphics2D graphics)

    - #### createRadialGradientPaint

          protected java.awt.Paint createRadialGradientPaint(PaintStyle.GradientPaint fill,
                                                             java.awt.Graphics2D graphics)

    - #### createPathGradientPaint

          protected java.awt.Paint createPathGradientPaint(PaintStyle.GradientPaint fill,
                                                           java.awt.Graphics2D graphics)

    - #### 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

    - #### RGB2HSL

          public static double[] RGB2HSL(java.awt.Color color)

      Convert a RGB Color to it corresponding HSL values.
      Returns:
        an array containing the 3 HSL values.

    - #### 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[])`

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.