* Last processed by NICE on 12-Jun-2000 15:54:00
* Customized for :  IEEE, LINUX, UNIX, MOTIF, F77
      SUBROUTINE HSV_TO_RGB(H,S,V,R,G,B)
C----------------------------------------------------------------------
C DISPLAY	Internal routine
C	Convert Hue-Saturation-Value to Red-Green-Blue color
C	representation.
C Arguments
C	H	R*4	Hue [0,360]		Input
C	S	R*4	Saturation [0,1]	Input
C	V	R*4	Value [0,1]		Input
C	R	R*4	Red [0,1]		Output
C	G	R*4	Green [0,1]		Output
C	B	R*4	Blue [0,1]		Output
C Device independent module
C----------------------------------------------------------------------
      REAL H,S,V,R,G,B,X
*
      X = MOD(H,360.0)
      IF (X.LT.60.0) THEN
         R = 1.0
         G = X/60.0
         B = 0.0
      ELSEIF (X.LT.120.0) THEN
         R = (120.0-X)/60.0
         G = 1.0
         B = 0.0
      ELSEIF (X.LT.180.0) THEN
         R = 0.0
         G = 1.0
         B = (X-120.0)/60.0
      ELSEIF (X.LT.240.0) THEN
         R = 0.0
         G = (240.0-X)/60.0
         B = 1.0
      ELSEIF (X.LT.300.0) THEN
         R = (X-240.0)/60.0
         G = 0.0
         B = 1.0
      ELSE
         R = 1.0
         G = 0.0
         B = (360.0-X)/60.0
      ENDIF
*
      B = V*((1.0-S)+S*B)
      G = V*((1.0-S)+S*G)
      R = V*((1.0-S)+S*R)
      END
*<FF>
