Hello,
it took me a half day to get the layer colors right.
Simple API addlayer() uses a colorName, addshape() uses a New Rcolor().
Added a layer with addlayer using "green" and I got dark green ... (0,128,0)
With "dark green" I got back even darker green ... (0,100,0)
Went through the whole RColor class, the GitHub masters and the forum back an forth ...
Collected these names from the 3 sources: "black" , "white" , "red" , "darkBlue"
I know "magenta" and "yellow" works too.
Found 2 or 3 lists depending on how deep you dig. (.js||.cpp||.h||*.*)
Tried the only other 'green' name I found: "l_green" and I got a pale green.
I just wanted the most standard QCAD (bright) green.
I queried that color with a script and I get "Green" (.getName()) "#00ff00" (.Name())
Capital "G" ... ok
Tried "Green" what offcourse gave back the same dark green ... (0,128,0)
Ended up with a list of the standard colors.
I'll start using these instead ...
#ff0000 - #00ff00 - #0000ff - #00ffff - #ff00ff - #ffff00 - #ff7f00
#800000 - #008000 - #000080 - #008080 - #800080 - #808000
#000000 - #a0a0a4 - #c0c0c0 - #ffffff
I can't list the names because of the green issue ...
I would not know how to call "#00ff00".
Simply "green" it is not.
Finally: addlayer( "MyLayer", "#00ff00", "CONTINUOUS", RLineweight.Weight013)
gave me a layer in standard green.
Regards,
CVH
The quest for the 'addlayer' with a green color
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Re: The quest for the 'addlayer' with a green color
The Qt doc refers to the SVG doc for supported color names:
https://www.w3.org/TR/SVG11/types.html#ColorKeywords
So that might be "lime".
RColor::getName should only be used to display the color name to the user. It's localized and does not match the table above.
For a localization neutral name use RColor::name() (QColor::name()) instead.
https://www.w3.org/TR/SVG11/types.html#ColorKeywords
So that might be "lime".
RColor::getName should only be used to display the color name to the user. It's localized and does not match the table above.
For a localization neutral name use RColor::name() (QColor::name()) instead.
Re: The quest for the 'addlayer' with a green color
Never would be able to come up with that.
Surely not the link with SVG colors.
Using the 'RLB' color index over 'RGB' (with L from 'lime' and not G from 'green')
Of course, as a man I am less gifted and have much fewer cones in my retina, so I looked up the color 'Lime'.
It still looks 'lime green' to me:
The lesser it has something to do with the color 'lime green'.
I read further that 'gray' is even worse ...
I will stick to a "#ff0000" line entity on a "#a0a0a4" layer inside a "#0000ff" polyline entity beside a "#00ff00" circle.
Should I revoke all my references to the 'green' color in all my post?
Regards,
CVH
Surely not the link with SVG colors.
Using the 'RLB' color index over 'RGB' (with L from 'lime' and not G from 'green')
Of course, as a man I am less gifted and have much fewer cones in my retina, so I looked up the color 'Lime'.
It still looks 'lime green' to me:
- Lime (color hex code #BFFF00) is a pure spectral color at approximately 564 nanometers.
The lesser it has something to do with the color 'lime green'.
I read further that 'gray' is even worse ...
I will stick to a "#ff0000" line entity on a "#a0a0a4" layer inside a "#0000ff" polyline entity beside a "#00ff00" circle.
Should I revoke all my references to the 'green' color in all my post?
Regards,
CVH