Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Colour.cc File Reference
#include "G4Colour.hh"
#include "G4Threading.hh"
#include <algorithm>

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 60 of file G4Colour.cc.

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