kcc5
Class KCC_GradientColors

Object
  extended by common:Generic
      extended by common:GradientWrapper
          extended by kcc5:KCC_ColorMapBase
              extended by kcc5:KCC_GradientColors

class 
KCC_ColorMapBase:KCC_GradientColors

Class for defining color maps using the gradient.

This class allows the gradient to be divided into color maps. The number of ranges and colors per range are specified to create the map.

Usually, it is better to use one of the predefined maps and customize it to your liking, rather than this class. The mapping of colors will be smoother and generally nicer looking.

This class is included primarily for historical purposes.


Ultra Fractal Source

Toggle UF Source Code Display

 class KCC_GradientColors( KCC_ColorMapBase ) {
 ; Class for defining color maps using the gradient.
 ; <p>
 ; This class allows the gradient to be divided into color maps.
 ; The number of ranges and colors per range are specified to
 ; create the map.
 ; <p>
 ; Usually, it is better to use one of the predefined maps and
 ; customize it to your liking, rather than this class.  The
 ; mapping of colors will be smoother and generally nicer looking.
 ; <p>
 ; This class is included primarily for historical purposes.
 ;
 public:
 $define DEBUG
   import "common.ulb"
 
   ; Constructor
   ; @param pparent = a reference to the object creating the new object; typically, 'this'
   func KCC_GradientColors( Generic pparent )
     KCC_ColorMapBase( pparent )
 
     colorRanges = @colorRanges
     colorOffset = @colorOffset
     colorsPerRange = @colorsPerRange
   endfunc
 
   color func getColorChannel( float pindex, int pchannel )
     pchannel = abs( (pchannel + colorOffset) % @colorRanges )
     if( @perturbRanges != "None" )
       pchannel = perturbRanges( pchannel )
     endif
     return gradient( ( (pindex * (@colorsPerRange - 1) ) + (pchannel * colorsPerRange) ) % 256 / 256 )
   endfunc
 
 protected:
   color colorMap[500,2]
   int colorsPerRange
   int colorRanges
   int colorOffset
 
 default:
   title = "Gradient Colors Map"
   
   rating = notRecommended
 
   int param v_KCC_GradientColors
     caption = "Version (KCC_GradientColors)"
     default = 100
     hint = "This version parameter is used to detect when a change has been \
             made to the formula that is incompatible with the previous version. \
             When that happens, this field will reflect the old version number to \
             alert you to the fact that an alternate rendering is being used."
     visible = @v_KCC_GradientColors < 100
   endparam
 
   int param colorOffset
     caption = "Range Offset"
     default = 0
     min = 0
     max = 500
     hint = "This is used to rotate the color ranges.  The offset can \
             range from 0 to 500."
   endparam
 
   int param colorRanges
     caption = "# of Ranges"
     min = 1
     max = 8
     default = 8
   endparam
 
   int param colorsPerRange
     caption = "Colors/Range"
     min = 1
     max = 255
     default = 30
   endparam
 }
 


Constructor Summary
KCC_GradientColors()
           
KCC_GradientColors(Generic pparent)
          Constructor
 
Method Summary
 color getColorChannel(float pindex, int pchannel)
          Lookup function supporting multiple channels By default, we use the UF gradient
 
Methods inherited from class kcc5:KCC_ColorMapBase
perturb8RangeMap, perturbRanges
 
Methods inherited from class common:GradientWrapper
getColor
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

KCC_GradientColors

public KCC_GradientColors(Generic pparent)
Constructor

Parameters:
pparent - = a reference to the object creating the new object; typically, 'this'

KCC_GradientColors

public KCC_GradientColors()
Method Detail

getColorChannel

public color getColorChannel(float pindex,
                             int pchannel)
Description copied from class: GradientWrapper
Lookup function supporting multiple channels By default, we use the UF gradient

Overrides:
getColorChannel in class KCC_ColorMapBase