de.dante.extex.color
Class ColorUtil

java.lang.Object
  extended byde.dante.extex.color.ColorUtil

public final class ColorUtil
extends java.lang.Object

This class provides some utility functions for colors.

Version:
$Revision: 1.1 $
Author:
Gerd Neugebauer

Method Summary
static void formatAlpha(java.lang.StringBuffer sb, long alpha)
          Format the alpha value.
static void formatComponent(java.lang.StringBuffer sb, long cc)
          Format a single color component: the color value from 0 to 0xffff is translated to a representation in the range 0.0 to 1.0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

formatComponent

public static void formatComponent(java.lang.StringBuffer sb,
                                   long cc)
Format a single color component: the color value from 0 to 0xffff is translated to a representation in the range 0.0 to 1.0.

Parameters:
sb - the target string buffer
cc - the color component

formatAlpha

public static void formatAlpha(java.lang.StringBuffer sb,
                               long alpha)
Format the alpha value. If it is the default value then nothing is added to the target string buffer. Otherwise the value in the range from 0.0 to 1.0 preceded by alpha is added.

Parameters:
sb - the target string buffer
alpha - the alpha value