Fill Area Attributes class.
This class is used (in general by secondary inheritance) by many other classes (graphics, histograms). It holds all the fill area attributes.
Fill Area attributes
Fill Area attributes are:
Fill Area color
The fill area color is a color index (integer) pointing in the ROOT color table. The fill area color of any class inheriting from TAttFill
can be changed using the method SetFillColor
and retrieved using the method GetFillColor
. The following table shows the first 50 default colors.
Color transparency
SetFillColorAlpha()
, allows to set a transparent color. In the following example the fill color of the histogram histo
is set to blue with a transparency of 35%. The color kBlue
itself remains fully opaque.
histo->SetFillColorAlpha(
kBlue, 0.35);
The transparency is available on all platforms when the flagOpenGL.CanvasPreferGL
is set to 1
in $ROOTSYS/etc/system.rootrc
, or on Mac with the Cocoa backend. On the file output it is visible with PDF, PNG, Gif, JPEG, SVG, TeX ... but not PostScript.
The ROOT Color Wheel.
The wheel contains the recommended 216 colors to be used in web applications. The colors in the Color Wheel are created by TColor::CreateColorWheel.
Using this color set for your text, background or graphics will give your application a consistent appearance across different platforms and browsers.
Colors are grouped by hue, the aspect most important in human perception Touching color chips have the same hue, but with different brightness and vividness.
Colors of slightly different hues clash. If you intend to display colors of the same hue together, you should pick them from the same group.
Each color chip is identified by a mnemonic (eg kYellow) and a number. The keywords, kRed, kBlue, kYellow, kPink, etc are defined in the header file Rtypes.h that is included in all ROOT other header files. We strongly recommend to use these keywords in your code instead of hardcoded color numbers, eg:
myObject.SetFillColor(
kRed);
Special case forcing black&white output.
If the current style fill area color is set to 0, then ROOT will force a black&white output for all objects with a fill area defined and independently of the object fill style.
Fill Area style
The fill area style defines the pattern used to fill a polygon. The fill area style of any class inheriting from TAttFill
can be changed using the method SetFillStyle
and retrieved using the method GetFillStyle
.
Conventions for fill styles:
- 0 : hollow
- 1001 : Solid
- 3000+pattern_number (see below)
- For TPad only:
- 4000 :the window is transparent.
4000 to 4100 the window is 100% transparent to 100% opaque.
The pad transparency is visible in binary outputs files like gif, jpg, png etc .. but not in vector graphics output files like PS, PDF and SVG. This convention (fill style > 4000) is kept for backward compatibility. It is better to use the color transparency instead.
pattern_number can have any value from 1 to 25 (see table), or any value from 100 to 999. For the latest the numbering convention is the following:
i (1-9) : specify the space between each hatch
j (0-9) : specify angle between 0 and 90 degrees
0 = 0
1 = 10
2 = 20
3 = 30
4 = 45
6 = 60
7 = 70
8 = 80
9 = 90
k (0-9) : specify angle between 90 and 180 degrees
0 = 180
1 = 170
2 = 160
3 = 150
4 = 135
6 = 120
7 = 110
8 = 100
9 = 90
auto Not(F &&f) -> decltype(RDFInternal::NotHelper(Args(), std::forward< F >(f)))
Given a callable with signature bool(T1, T2, ...) return a callable with same signature that returns ...
RooCmdArg FillStyle(Style_t style)
static constexpr double mm
The following table shows the list of pattern styles. The first table displays the 25 fixed patterns. They cannot be customized unlike the hatches displayed in the second table which be customized using:
gStyle->SetHatchesSpacing()
to define the spacing between hatches.
gStyle->SetHatchesLineWidth()
to define the hatches line width.
Definition at line 19 of file TAttFill.h.