home *** CD-ROM | disk | FTP | other *** search
- /*
- @N
-
- This Genie will convert the current selection of objects to shades of gray
- */
- call pdm_AutoUpdate(0)
-
- obj = pdm_SelFirstObj()
- if obj = 0 then exit_msg("Please select a group of objects first")
-
- do while obj ~= 0
-
- lcdata = pdm_GetColorData(pdm_GetLineColor(obj))
- red = min(15, word(lcdata, 1) * .3)
- green = min(15, word(lcdata, 2) * .59)
- blue = min(15, word(lcdata, 3) * .11)
- lcdata = red + green + blue
- call pdm_SetLineColor(obj, "UNNAMED RGB "lcdata" "lcdata" "lcdata)
-
- fill = pdm_GetFillPattern(obj)
- parse var fill type '0a'x color1 '0a'x color2 '0a'x a '0a'x b '0a'x c '0a'x d
-
- if type ~= 0 then
- do
-
- color1 = pdm_GetColorData(color1)
- red = min(15, word(color1, 1) * .3)
- green = min(15, word(color1, 2) * .59)
- blue = min(15, word(color1, 3) * .11)
- grey = red + green + blue
- color1 = "UNNAMED RGB "grey" "grey" "grey
-
- if type > 1 then
- do
- color2 = pdm_GetColorData(color2)
- red = min(15, word(color2, 1) * .3)
- green = min(15, word(color2, 2) * .59)
- blue = min(15, word(color2, 3) * .11)
- grey = red + green + blue
- color2 = "UNNAMED RGB "grey" "grey" "grey
- end
-
- call pdm_SetFillPattern(obj, type, color1, color2, a, b, c, d)
- end
-
- obj = pdm_SelNextObj(obj)
-
- end
-
- exit_msg()
-
- exit_msg: procedure
- do
- parse arg message
-
- if message ~= 0 then call pdm_Inform(1,message,)
- call pdm_AutoUpdate(1)
- exit
- end
-
-