Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Colour.cc File Reference
#include "G4Colour.hh"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const G4Colour &c)
 

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const G4Colour c 
)

Definition at line 55 of file G4Colour.cc.

55 {
56 os << '(' << c.red << ',' << c.green << ',' << c.blue
57 << ',' << c.alpha << ')';
58 const std::map<G4String, G4Colour>& colourMap = G4Colour::GetMap();
59 // Reverse iterator to pick up English spelling of grey!! :)
60 std::map<G4String, G4Colour>::const_reverse_iterator ri;
61 for (ri = colourMap.rbegin(); ri != colourMap.rend(); ++ri) {
62 if (c == ri->second) {
63 os << " (" << ri->first << ')';
64 break;
65 }
66 }
67
68 return os;
69}
static const std::map< G4String, G4Colour > & GetMap()
Definition: G4Colour.cc:144