Design Scripting Documentation
     
 
     
  Color Ramp Cold/Hot Reverse  
     
     
  Inputs:  
     
an rgb color
     
  Outputs:  
     
the sample value
     
  Implementation
01  function color_coldhotrev( color )
02    dim sample: sample = color_rgb( color )
03  
04    sample( COLOR_R ) = sample( COLOR_R ) / NUMBER_MAX_BYTE
05    sample( COLOR_G ) = sample( COLOR_G ) / NUMBER_MAX_BYTE
06    sample( COLOR_B ) = sample( COLOR_B ) / NUMBER_MAX_BYTE
07  
08    dim r: r = ( sample( COLOR_R ) = 1.0 )
09    dim g: g = ( sample( COLOR_G ) = 1.0 )
10    dim b: b = ( sample( COLOR_B ) = 1.0 )
11  
12    if( ( not r ) and b ) then
13      color_coldhotrev = sample( COLOR_G ) / 4.0
14    elseif( ( not r ) and g ) then
15      color_coldhotrev = 0.5 - sample( COLOR_B ) / 4.0
16    elseif( g and ( not b ) ) then
17      color_coldhotrev = 0.5 + sample( COLOR_R ) / 4.0
18    elseif( r and ( not b ) ) then
19      color_coldhotrev = 1.0 - sample( COLOR_G ) / 4.0
20    else
21      color_coldhotrev = -1.0
22    end if
23  end function
 
     

Creative Commons License
The Design Scripting Library, including its sources, online documentation and graphics, are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Online Documentation generated by { vbdoclib } version 1.0
Color-Coding generated by { vbcc } version 2.0
Page timestamp: { Feb. 2, 2006 }





 
     
     
 
Documentation
Cover Page
Expand
Collapse
 
Array
 
Bitmap File
 
Bounding Box
 
Color
 
Container
 
Doclet
 
Ellipse
 
Intersection
 
Language
 
Map
 
Matrix
 
Number
 
Nurbs
 
Range
 
STL File
 
Streams
 
String
 
Surface
 
Text File
 
Triangle
 
Vector
 
Vertex
 
Wave File