/usr/include/root/TColorGradient.h is in libroot-core-dev 5.34.14-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | // @(#)root/base:$Id$
//Author: Timur Pocheptsov 20/03/2012
/*************************************************************************
* Copyright (C) 1995-2012, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TColorGradient
#define ROOT_TColorGradient
//////////////////////////////////////////////////////////////////////////
// //
// TColorGradient //
// //
// TColorGradient extends basic TColor. //
// Actually, this is not a simple color, but linear gradient + shadow //
// for filled area. By inheriting from TColor, gradients can be placed //
// inside gROOT's list of colors and use it in all TAttXXX descendants //
// without modifying any existing code. //
// Shadow, of course, is not a property of any color, and gradient is //
// not, but this is the best way to add new attributes to filled area //
// without re-writing all the graphics code. //
// //
//////////////////////////////////////////////////////////////////////////
#include <vector>
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
#ifndef ROOT_TColor
#include "TColor.h"
#endif
class TColorGradient : public TColor {
public:
enum EGradientDirection {
kGDVertical,
kGDHorizontal
};
typedef std::vector<Color_t>::size_type SizeType_t;
private:
//At the moment, we have only linear gradient, vertical or horizontal.
EGradientDirection fGradientDirection;
//Positions of color nodes in gradient. Should be normalized : [0, 1].
std::vector<Double_t> fColorPositions;
std::vector<Double_t> fColors;//RGBA values.
public:
//TColorGradient();
TColorGradient(Color_t newColor, EGradientDirection direction, UInt_t nPoints,
const Double_t *points, const Color_t *colorIndices);
TColorGradient(Color_t newColor, EGradientDirection direction, UInt_t nPoints,
const Double_t *points, const Double_t *colors);
void ResetColor(EGradientDirection direction, UInt_t nPoints, const Double_t *points,
const Color_t *colorIndices);
void ResetColor(EGradientDirection direction, UInt_t nPoints, const Double_t *points,
const Double_t *colorIndices);
EGradientDirection GetGradientDirection()const;
SizeType_t GetNumberOfSteps()const;
const Double_t *GetColorPositions()const;
const Double_t *GetColors()const;
private:
void RegisterColor(Color_t colorIndex);
ClassDef(TColorGradient, 1) //Extended drawing parameters
};
#endif
|