Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/base/src/TAttFill.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void TAttFill::SetFillAttributes()
/// Set a transparent fill color.
/// \param fcolor defines the fill color
/// \param falpha defines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
/// \note falpha is ignored (treated as 1) if the TCanvas has no GL support activated.
/// \note falpha is used only on the [supported platforms](\ref col_trans_available).

void TAttFill::SetFillColorAlpha(Color_t fcolor, Float_t falpha)
{
Expand Down
2 changes: 1 addition & 1 deletion core/base/src/TAttLine.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void TAttLine::SetLineAttributes()
/// Set a transparent line color.
/// \param lcolor defines the line color
/// \param lalpha defines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
/// \note lalpha is ignored (treated as 1) if the TCanvas has no GL support activated.
/// \note lalpha is used only on the [supported platforms](\ref col_trans_available).

void TAttLine::SetLineColorAlpha(Color_t lcolor, Float_t lalpha)
{
Expand Down
2 changes: 1 addition & 1 deletion core/base/src/TAttMarker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void TAttMarker::SetMarkerAttributes()
/// Set a transparent marker color.
/// \param mcolor defines the marker color
/// \param malpha defines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
/// \note malpha is ignored (treated as 1) if the TCanvas has no GL support activated.
/// \note malpha is used only on the [supported platforms](\ref col_trans_available).

void TAttMarker::SetMarkerColorAlpha(Color_t mcolor, Float_t malpha)
{
Expand Down
2 changes: 1 addition & 1 deletion core/base/src/TAttText.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void TAttText::SetTextAttributes()
/// Set a transparent text color.
/// \param tcolor defines the text color
/// \param talpha defines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
/// \note talpha is ignored (treated as 1) if the TCanvas has no GL support activated.
/// \note talpha is used only on the [supported platforms](\ref col_trans_available).

void TAttText::SetTextColorAlpha(Color_t tcolor, Float_t talpha)
{
Expand Down
19 changes: 16 additions & 3 deletions core/base/src/TColor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,22 @@ is set to blue with an opacity of 35% (i.e. a transparency of 65%).
histo->SetFillColorAlpha(kBlue, 0.35);
~~~

The transparency is available on all platforms when the flag `OpenGL.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.
\anchor col_trans_available

#### Note:

Transparency is supported by the following graphics backends:

- OpenGL
- Cocoa/Quartz (macOS)
- SVG
- PDF
- TeX
- PNG, GIF, and JPEG
- TWebCanvas
- Future `TCanvasImp` implementations, such as `qt6canvas`

Transparency is **not** supported by the X11 and PostScript backends.

Alternatively, you can call at the top of your script `gStyle->SetCanvasPreferGL();`.
Or if you prefer to activate GL for a single canvas `c`, then use `c->SetSupportGL(true);`.
Expand Down
Loading