ATLAS Offline Software
VP1ColorUtils.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6  * author: Riccardo Maria BIANCHI <riccardo.maria.bianchi@cern.ch>, 2022 Jan
7  *
8  * The class offers different conversion tools and helpers to handle colors in different formats.
9  * In particular, it helps setting the Coin colors, which are defined in the [0.0, 1.0] range,
10  * from standard RGB values, which are defined in the [0, 255] range.
11  *
12  */
13 
14 #ifndef VP1UTILSCOINSOQT_VP1COLORUTILS_H
15 #define VP1UTILSCOINSOQT_VP1COLORUTILS_H
16 
17 
18 #include <string>
19 
20 
21 // FWD declarations
22 class SoMaterial;
23 class SbColor;
24 
26 
27  public:
28 
29 // set SoMaterial color from RGB values
30  static void setMatColorFromRGB(SoMaterial* mat, const std::string& type, const unsigned int r, const unsigned int g, const unsigned int b);
31  static SbColor getSbColorFromRGB(const unsigned int r, const unsigned int g, const unsigned int b);
32 
33  // convert the usual range RGB [0,255] to Coin [0,1]
34  static float getValFromRGB(const unsigned int rgb);
35 };
36 
37 #endif
beamspotman.r
def r
Definition: beamspotman.py:676
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
VP1ColorUtils::getValFromRGB
static float getValFromRGB(const unsigned int rgb)
Definition: VP1ColorUtils.cxx:18
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
VP1ColorUtils::setMatColorFromRGB
static void setMatColorFromRGB(SoMaterial *mat, const std::string &type, const unsigned int r, const unsigned int g, const unsigned int b)
Definition: VP1ColorUtils.cxx:27
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
VP1ColorUtils
Definition: VP1ColorUtils.h:25
VP1ColorUtils::getSbColorFromRGB
static SbColor getSbColorFromRGB(const unsigned int r, const unsigned int g, const unsigned int b)
Definition: VP1ColorUtils.cxx:46
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78