コード例 #1
0
 /**
  * Specifies the tint value applied to the ctColor.
  *
  * <p>If tint is supplied, then it is applied to the RGB value of the ctColor to determine the
  * final ctColor applied.
  *
  * <p>The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0
  * means 100% lighten. Also, 0.0 means no change.
  *
  * <p>In loading the RGB value, it is converted to HLS where HLS values are (0..HLSMAX), where
  * HLSMAX is currently 255. Here are some examples of how to apply tint to ctColor:
  *
  * <blockquote>
  *
  * <pre>
  * If (tint &lt; 0)
  * Lum' = Lum * (1.0 + tint)
  *
  * For example: Lum = 200; tint = -0.5; Darken 50%
  * Lum' = 200 * (0.5) =&gt; 100
  * For example: Lum = 200; tint = -1.0; Darken 100% (make black)
  * Lum' = 200 * (1.0-1.0) =&gt; 0
  * If (tint &gt; 0)
  * Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint))
  * For example: Lum = 100; tint = 0.75; Lighten 75%
  *
  * Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75))
  * = 100 * .25 + (255 - 255 * .25)
  * = 25 + (255 - 63) = 25 + 192 = 217
  * For example: Lum = 100; tint = 1.0; Lighten 100% (make white)
  * Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1))
  * = 100 * 0 + (255 - 255 * 0)
  * = 0 + (255 - 0) = 255
  * </pre>
  *
  * </blockquote>
  *
  * @param tint the tint value
  */
 public void setTint(double tint) {
   ctColor.setTint(tint);
 }