home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / amiga / opalvisn / dropshdw.lha / Bevell.oprx < prev    next >
Text File  |  1992-10-22  |  1KB  |  85 lines

  1. /* Draw a bevelled drop box using OpalPaint.
  2.  */
  3.  
  4.  
  5. address 'OpalPaint_Rexx'
  6.  
  7. options Results
  8.  
  9. SaveSetUp
  10. GetRect
  11. parse var Result X1  Y1  X2  Y2
  12.  
  13. Depth = 10        /* Could use AskInt here */
  14.  
  15. GetPen
  16. RGBtoHSV Result
  17. Parse var Result Hue Sat Val
  18.  
  19.     /* Box body. Set up a diagonal HSV gradient */
  20.  
  21. FillMode Gradient
  22. ClearColGrad
  23. ClearTransGrad
  24. ColourDither 0
  25. TransDither 0
  26.  
  27. HSVtoRGB Hue Sat Val
  28. ColGradTag 0 Result
  29. S2 = (Sat-(0.4*65535))%1 /* Note: %1 converts number to an integer */
  30. S2 = MAX(S2,0)    
  31. HSVtoRGB Hue S2 Val
  32. ColGradTag 0.5 Result
  33. HSVtoRGB Hue Sat Val
  34. ColGradTag 1 Result
  35. GradType LinearFree HSV
  36. GradRange X1+Depth Y1+Depth X2-Depth Y2-Depth
  37. SolidRect X1+Depth Y1+Depth X2-Depth Y2-Depth
  38.  
  39. FillMode Solid
  40.     /* Top */
  41.  
  42. V2 = (Val+0.1*65535)%1
  43. V2 = MIN(V2,65535)
  44.  
  45. HSVtoRGB Hue Sat V2
  46. SetPen Result
  47.  
  48. SolidPoly X1 Y1 X2 Y1 X2-Depth Y1+Depth X1+Depth Y1+Depth X1 Y1
  49. LastPoint
  50.  
  51.  
  52.     /* Right */
  53.  
  54. V2 = (Val-0.15*65535)%1
  55. V2 = MAX(V2,0)
  56.  
  57. HSVtoRGB Hue Sat V2
  58. SetPen Result
  59.  
  60. SolidPoly X2 Y1 X2 Y2 X2-Depth Y2-Depth X2-Depth Y1+Depth X2 Y1
  61. LastPoint
  62.  
  63.     /* Left */
  64.  
  65. V2 = (Val+0.15*65535)%1
  66. V2 = MIN(V2,65535)
  67.  
  68. HSVtoRGB Hue Sat V2
  69. SetPen Result
  70.  
  71. SolidPoly X1 Y1 X1+Depth Y1+Depth X1+Depth Y2-Depth X1 Y2 X1 Y1
  72. LastPoint
  73.  
  74.     /* Bottom */
  75.  
  76. V2 = (Val-0.1*65535)%1
  77. V2 = MAX(V2,0)
  78.  
  79. HSVtoRGB Hue Sat V2
  80. SetPen Result
  81.  
  82. SolidPoly X2 Y2 X1 Y2 X1+Depth Y2-Depth X2-Depth Y2-Depth X2 Y2
  83. LastPoint
  84. RestoreSetUp
  85.