The quest for the 'addlayer' with a green color
Posted: Tue Sep 15, 2020 9:43 am
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
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