PeterT Posted August 24, 2005 Share Posted August 24, 2005 Hi, I am writing a script that will print something in black, but its layer color is grey. In my script, I change the layer's Fill Fore color to from grey to black (0,0,17), do a call to the print command, then change the layer's Fill Fore color back to grey (187,187,187). In the execution, the change is made to black, and it prints, but after it prints it does not change back to grey. I have tried adding RedrawAlls, and then I put a SysBeep in after the DoMenuTextByName to make sure something would work after it, and it sounds the alert, but does not change the layer color. What am I missing? code: PROCEDURE PrintPresent; VAR currentlayer: HANDLE; currentname: STRING; BEGIN IF GetLayerByName('ARCH STAMP (1/1)')<> NIL THEN BEGIN currentlayer:=ActLayer; currentname:=GetLName(currentlayer); Layer('BASE PLAN'); LFillFore(0,0,17); RedrawAll; DOMENUTEXTBYNAME('Print', 0); LFillFore(187,187,187); RedrawAll; Sysbeep; Layer(currentname); END; END; RUN(PrintPresent); [/code] Quote Link to comment
ccroft Posted August 25, 2005 Share Posted August 25, 2005 Peter I'm no RGB wiz. Are you looking for the grey in the color palette that's 4 down and 2 over? That's 187,187,187 in 8 bit color but it's 59797,59797,59797 in 16. I think you might be setting back to a different black. I'm fairly sure we're talking 16 bit with VW 11 in OSX. Alternatively, you might be able to use Push/PopAttrs, but I'm not sure if it wil capture/reset layer fill. Charles Quote Link to comment
ccroft Posted August 25, 2005 Share Posted August 25, 2005 I don't know the color picker, but if you want light gray try: LFillFore(59797,59797,59797); Function Reference:"RGB values are in the range of 0~65535". White is 65535,65535,65535. You're not adding enough color to see anything but black with 3 digit numbers. You need much higher numbers. Check out the "Digital Color Meter" in utilities folder, set it to "RGB as Actual Value - 16 bit" and run that around the color palette. Or write a simple script using ColorIndexToRGB and Message(r,g,b) to get the correct values. I tested both LFillFore and LFillBack and they both worked in a simple script with just these calls and redrawall. On this machine 255,0,0 is black.So is 187,187,187. Also,you might want to ensure that your document preferences are set correctly to show these changes. On my machine "Use Layer Colors" is checked, and "Black and White Only" is unchecked. HTH Charles [ 08-25-2005, 06:00 PM: Message edited by: ccroft ] Quote Link to comment
PeterT Posted August 26, 2005 Author Share Posted August 26, 2005 I am just using the RGB values given using the color picker on any square in the color palette. I have tested it further and it doesn't seem to matter what color you try to change the layer fill to, it always changes to black. I tried to make it red by making the layer active and using LFillFore(255,0,0) and that changed it to black (0,0,0). I then tried using SetFillFore(layerhandle,255,0,0) using a handle to the layer, and that also changed the color to (0,0,0) In VectorScript, is black your only choice for Fill Fore color? Quote Link to comment
PeterT Posted August 27, 2005 Author Share Posted August 27, 2005 Charles, Thanks for all the input. I tried with 16 bit numbers and it seems to be working better. I will get back to this when I have time. Quote Link to comment
ccroft Posted August 27, 2005 Share Posted August 27, 2005 I just stumbled into something that might be helpful: Tool>Utilities>Read Color Palette It makes a text file of the all the RGB values of the all the colors in the current color palette, and lists them by row and column. Could be a useful reference. Charles Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.