That should read
G4VisAttributes blue(G4Colour( 0., 0., 1. ));
This is a matter of understanding C++. It looks like you need to take a course in C++ programming. It’s nonsense to say G4VisAttributes G4Colour
. So:
- A quick look at almost any example will show how it’s done. Have a look at
examples/basic/B5/src/DetectorConstruction.cc
.
- Colours can be set by commands. See B1/vis.mac.
- The ultimately, the header files
G4VisAttributes.hh' and
G4Colour.hh’ define what’s available.
You can also, for example
G4Colour pink;
G4Colour::GetColour("pink", pink);
chamber1Logical->SetVisAttributes(pink);
There’s a cryptic command just after the list of registered graphics systems:
Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
which perhaps should also say these colours are also available in C++. When you issue /vis/list
, you get:
Some /vis commands (optionally) take a string to specify colour.
Available colours:
aquamarine, black, blue, blueviolet, brown, cadetblue, coral, cornflowerblue, cyan,
darkgreen, darkolivegreen, darkorchid, darkslateblue, darkslategrey, darkturquoise,
dimgrey, firebrick, forestgreen, gold, goldenrod, gray, green, greenyellow, grey, indianred,
khaki, lightblue, lightgrey, lightsteelblue, limegreen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue, navy, navyblue, orange, orangered,
orchid, palegreen, pink, plum, red, salmon, seagreen, sienna, skyblue, slateblue,
springgreen, steelblue, tan, thistle, turquoise, violet, violetred, wheat, white, yellow,
yellowgreen