Style
CalSciPy Style
Access to the styles utilized by CalSciPy is provided through COLORS
,
TERM_SCHEME
, ColorSpectrum, and through
matplotlib's
style contexts.
Color Scheme
Access to COLORS
permits retrieval of the associated RGB tuple for a desired
color through its name, index, or directly through its attribute implementation. More information on which colors are
available can be found here
.
Using CalSciPy’s Color Scheme
from CalSciPy.color_scheme import COLORS
red = COLORS.RED
red = COLORS("red")
red = COLORS(0)
red, green, blue = [COLORS(i) for i in range(3)]
Matplotlib Style
Users can utilize CalSciPy’s matplotlib
style through
matplotlib's style context manager
.
Using CalSciPy’s Matplotlib Style
import matplotlib
from matplotlib import pyplot as plt
with plt.style.context("CalSciPy.main"):
fig = plt.figure()
Terminal Style
Users can utilize CalSciPy’s terminal printing style by using TERM_SCHEME
.
Calling TERM_SCHEME
with a specific property or attribute string alongside
a string message will return your original message with the requested formatting. More information on available
formatting can be found here
.
Using CalSciPy’s Terminal Style
from CalSciPy.color_scheme import TERM_SCHEME
message = "Hello World!"
formatted_message = TERM_SCHEME(message, "header")