shiori Posted August 17, 2022 Share Posted August 17, 2022 Hi everybody. I am setting the color to the object. However, the set color is not reflected correctly. PROCEDURE Test; VAR leftTop,rightDown:POINT; hdl:HANDLE; r,g,b:LONGINT; BEGIN {Create Rectangle} leftTop.x := 0; leftTop.y := 100; rightDown.x := 100; rightDown.y := 0; Rect(leftTop.x,leftTop.y,rightDown.x,rightDown.y); hdl := LNewObj; {Set Color (RGB(50,0,200))} r := ROUND(50/255*65535); g := ROUND(0/255*65535); b := ROUND(200/255*65535); SetFillBack(hdl,r,g,b); END; Run(Test); The settings of the drawn object are like this. →R:49/G:0/B:200 Green and blue values are correct. But the red value is wrong. What's wrong? By the way, some colors are set correctly with the same code. For example, RGB(220,220,220) and RGB(255,0,99) etc... Thanks. Quote Link to comment
shiori Posted August 17, 2022 Author Share Posted August 17, 2022 I am using Vectorworks2020 SP6 (Build 580724) 64bit. Thank you again. Quote Link to comment
PatW Posted August 17, 2022 Share Posted August 17, 2022 I think the conversion is not correct, try it with: rgb16bit = rgb8Value * 257; 255 * 257 = 65.535 Quote Link to comment
shiori Posted August 18, 2022 Author Share Posted August 18, 2022 Thank you for your reply. I tried it but no change. {Set Color (RGB(50,0,200))} r := ROUND(50/255*65535); g := ROUND(0/255*65535); b := ROUND(200/255*65535); SetFillBack(hdl,r,g,b); ↓Change {Set Color (RGB(50,0,200))} r := 50*257; g := 0*257; b := 200*257; SetFillBack(hdl,r,g,b); Quote Link to comment
MullinRJ Posted August 18, 2022 Share Posted August 18, 2022 (edited) Hi @shiori, I just tried setting the fill color of a rectangle to 50, 0, 200 using your new script snippet and I get the expected result. When I open the color palette to show Active Document Colors, the last color is the newly created color, and as you can see from the screen shot it is correct. This is using VW 2020 SP6. I also tried it in VW 2022 SP4 and it also works. I think you are seeing a bug with the RGB Color Picker. It does not report correct values. I see you are on a PC. I am using a MAC, and I see a similar distortion in the RGB numbers when I look at the RGB slider values, and the Spectrum displays. When you select an object, open the color picker in the Attributes Palette and select the Active Document button (it's the top button at the bottom of the color window). One of the colors will be highlighted which corresponds to your selected object. Hover your cursor over that color swatch and the color values should popup in about a second. Use these values to determine your color. HTH, Raymond PS - I believe this bug has been reported. If not I'll enter one tomorrow. Edited August 18, 2022 by MullinRJ Quote Link to comment
rDesign Posted August 18, 2022 Share Posted August 18, 2022 If this is the RGB color shift bug, hopefully it will be addressed with the color palette revisions coming in Vw 2023. Quote Link to comment
shiori Posted August 18, 2022 Author Share Posted August 18, 2022 Hi @MullinRJ. Thank you for your reply. Also, thanks for the detailed explanation!! I was able to confirm the correct color. I hope the bug is fixed. Hi @rDesign. Thank you for information. I also hope that it will be addressed. 1 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.