This repository contains RWTH Aachen University's corporate design color definitions in different formats. See here for oringinal color defintions (German only)
An XML file containing most RWTH colors
.css file containing all RWTH Colors
.tex file containing all RWTH Colors for use with the xcolor package
A json file containing all RWTH Colors for use with draw.io
To integrate RWTH's colors into your python application, you can use the rwthcolors package
You can install rwthcolors via pip:
pip install rwthcolors
# RWTHColors Python Package
## Overview
The `rwthcolors` package allows you to integrate RWTH's official color palette into your Python applications, particularly for use with matplotlib.
## Installation
Install `rwthcolors` via pip:
```bash
pip install rwthcolors
To automatically set the default color cycle to RWTH colors, simply import:
import RWTHColors
This will make all matplotlib figures by default use RWTH colors!
Alternatively, apply RWTH colors to your matplotlib plots using:
plt.style.use('rwth')
Additional styles include:
rwth-full
: A color cycle with more colors.rwth-dark
: For dark backgrounds. Use it with:with plt.style.context(['dark_background', 'rwth-dark']): # Your plotting code here
To access colors explicitly, use ColorManager
:
from RWTHColors import ColorManager
cm = ColorManager()
Example to get RWTH black at 75% intensity:
c = cm.RWTHSchwarz.p(75)
By default, this returns the HEX code. For RGB codes, instantiate ColorManager
with:
cm = ColorManager(frmt='RGB')
Retrieve colors directly by calling them:
c = cm.RWTHBlau() # RWTHBlau at 100%
c = cm.RWTHBlau(50) # RWTHBlau at 50%
Print color values using:
print(RWTHRot.colors('RGB')) # or
print(RWTHRot())
When instantiated, ColorManager
replaces matplotlib's default color cycle with the cycle used in the rwth
mplstyle.
Display all RWTH colors with:
cm.plot_color_palette()
Enhance your plots by combining rwthcolors
with the SciencePlots package. Example style combination:
with plt.style.context(['science', 'grid', 'rwth']):
# Your plotting code here
import matplotlib.pyplot as plt
import numpy as np
import RWTHColors
import scienceplots
plt.style.use(['science', 'grid', 'rwth'])
x = np.arange(0, 4*np.pi, .01)
fig, ax = plt.subplots(1, 1, figsize=(10, 4))
for a in [1, 2, 3, 4, 5, 6, 7, 8]:
ax.plot(x, a*np.sin(x), label='$\hat{a}=$' + '${}$'.format(a))
ax.legend(loc=1)
ax.set_xlabel('$x$')
ax.set_ylabel('$f(x)$')
plt.show()
This produces:
This repository is not maintained by RWTH Aachen University's marketing department but a voluntary offer by the Institute of Rail Vehicles and Transport Systems. If you have the color definitions in other formats, feel free to contribute them using a merge request.