CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
public_plots_tools.ColorScheme Class Reference
Inheritance diagram for public_plots_tools.ColorScheme:

Public Member Functions

def __init__ (self, name)
 
def InitColors (cls)
 

Public Attributes

 color_by_year
 
 color_fill_cert
 
 color_fill_del
 
 color_fill_peak
 
 color_fill_pileup
 
 color_fill_rec
 
 color_line_cert
 
 color_line_del
 
 color_line_peak
 
 color_line_pileup
 
 color_line_rec
 
 file_suffix
 
 logo_name
 
 name
 

Detailed Description

A bit of a cludge, but a simple way to store color choices.

Definition at line 111 of file public_plots_tools.py.

Constructor & Destructor Documentation

def public_plots_tools.ColorScheme.__init__ (   self,
  name 
)

Definition at line 147 of file public_plots_tools.py.

147  def __init__(self, name):
148 
149  self.name = name
150 
151  # Some defaults.
152  self.color_fill_del = "black"
153  self.color_fill_rec = "white"
154  self.color_fill_cert = "red"
155  self.color_fill_peak = "black"
160  self.color_by_year = {
161  2010 : "green",
162  2011 : "red",
163  2012 : "blue"
164  }
165  self.color_line_pileup = "black"
166  self.color_fill_pileup = "blue"
167  self.logo_name = "cms_logo.png"
168  self.file_suffix = "_%s" % self.name.lower()
169 
170  tmp_name = self.name.lower()
171  if tmp_name == "greg":
172  # Color scheme 'Greg'.
173  self.color_fill_del = ColorScheme.cms_blue
174  self.color_fill_rec = ColorScheme.cms_orange
175  self.color_fill_cert = ColorScheme.cms_lightyellow
176  self.color_fill_peak = ColorScheme.cms_orange
181  self.color_line_pileup = "black"
182  self.color_fill_pileup = ColorScheme.cms_blue
183  self.logo_name = "cms_logo.png"
184  self.file_suffix = ""
185  elif tmp_name == "joe":
186  # Color scheme 'Joe'.
187  self.color_fill_del = ColorScheme.cms_yellow
188  self.color_fill_rec = ColorScheme.cms_red
189  self.color_fill_cert = ColorScheme.cms_orange
190  self.color_fill_peak = ColorScheme.cms_red
195  self.color_line_pileup = "black"
196  self.color_fill_pileup = ColorScheme.cms_yellow
197  self.logo_name = "cms_logo_alt.png"
198  self.file_suffix = "_alt"
199  else:
200  print("ERROR Unknown color scheme '%s'" % self.name, file=sys.stderr)
201  sys.exit(1)
202 
203  # Find the full path to the logo PNG file.
204  # NOTE: This is a little fragile, I think.
205  logo_path = os.path.realpath(os.path.dirname(__file__))
206  self.logo_name = os.path.join(logo_path,
207  "../plotdata/%s" % self.logo_name)
208 
209  # End of __init__().
210 
def DarkenColor(color_in)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66

Member Function Documentation

def public_plots_tools.ColorScheme.InitColors (   cls)

Definition at line 115 of file public_plots_tools.py.

115  def InitColors(cls):
116 
117  #------------------------------
118  # For color scheme 'Greg'.
119  #------------------------------
120 
121  # This is the light blue of the CMS logo.
122  ColorScheme.cms_blue = (0./255., 152./255., 212./255.)
123 
124  # This is the orange from the CMS logo.
125  ColorScheme.cms_orange = (241./255., 194./255., 40./255.)
126 
127  # Slightly darker versions of the above colors for the lines.
128  ColorScheme.cms_blue_dark = (102./255., 153./255., 204./255.)
129  ColorScheme.cms_orange_dark = (255./255., 153./255., 0./255.)
130 
131  #------------------------------
132  # For color scheme 'Joe'.
133  #------------------------------
134 
135  # Several colors from the alternative CMS logo, with their
136  # darker line variants.
137 
138  ColorScheme.cms_red = (208./255., 0./255., 37./255.)
139  ColorScheme.cms_yellow = (255./255., 248./255., 0./255.)
140  ColorScheme.cms_purple = (125./255., 16./255., 123./255.)
141  ColorScheme.cms_green = (60./255., 177./255., 110./255.)
142  ColorScheme.cms_orange2 = (227./255., 136./255., 36./255.)
143  ColorScheme.cms_lightyellow = (255./255., 235./255., 215./255.)
144 
145  # End of InitColors().
146 

Member Data Documentation

public_plots_tools.ColorScheme.color_by_year

Definition at line 160 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_fill_cert

Definition at line 154 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_fill_del

Definition at line 152 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_fill_peak

Definition at line 155 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_fill_pileup

Definition at line 166 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_fill_rec

Definition at line 153 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_line_cert

Definition at line 158 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_line_del

Definition at line 156 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_line_peak

Definition at line 159 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_line_pileup

Definition at line 165 of file public_plots_tools.py.

public_plots_tools.ColorScheme.color_line_rec

Definition at line 157 of file public_plots_tools.py.

public_plots_tools.ColorScheme.file_suffix

Definition at line 168 of file public_plots_tools.py.

public_plots_tools.ColorScheme.logo_name

Definition at line 167 of file public_plots_tools.py.

public_plots_tools.ColorScheme.name