#local 
fRingGradient=
function
{
    
(sqrt((x*x)+(y*y)+(z*z))-InnerEdge)/(OuterEdge-InnerEdge)
}
 
#local 
fRingColour=
function
{
    
pigment
    {
        
image_map
        
{
    
        png 
"bjj\sat_ring_color.png"
        
    interpolate 4
    
    
}
    }
}
 
#local 
pRingColour=
function
{
    
pigment
    {
        
colour 
fRingColour(fRingGradient(x, y, 0),0,0)
    
}
}
 
fRingGradient() returns a value from 0 
to 1 
depending where on the ring disk x,y,z is. 0 at inner edge, 1 at outer 
edge
fRingColour() returns a square pigment 
loaded with 
the imagemap file. This file is 800px wide and 1px high.
pRingColour() should return the colour 
from the 
image mapping the square image onto the ring. 
 
Unfortunately it appears that in 
pRingColour() the 
x and y are no longer the parameters, but have reverted to the standard 
vectors. 
 
I have tried removing the 
"colour" keyword, 
removing the "pigment" all to no avail.
 
There is something odd going on 
here.
 
Rarius