Styles
Pygments comes with the following builtin styles. For more information about styles refer to the documentation.
bw
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
sas
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
staroffice
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
xcode
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
default
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
monokai
from typing import Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
lightbulb
from typing import Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
github-dark
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
rrt
from typing import Iterator # This is an example class Math: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
Styles with a lower contrast
The following styles do not meet the WCAG 2.1 AA contrast minimum, so they might be difficult to read for people with suboptimal vision. If you want your highlighted code to be well readable for other people, you should use one of the earlier styles instead.
abap
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
algol
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
algol_nu
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
arduino
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
autumn
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
borland
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
colorful
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
igor
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
lovelace
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
murphy
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
pastie
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
rainbow_dash
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
stata-light
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
trac
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
vs
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
emacs
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
tango
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
solarized-light
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
manni
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
gruvbox-light
from typing import Iterator # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
friendly
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
friendly_grayscale
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
perldoc
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
paraiso-light
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
zenburn
from typing import Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
nord
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
material
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
one-dark
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
dracula
from typing import Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
nord-darker
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
gruvbox-dark
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
stata-dark
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
paraiso-dark
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
coffee
from typing import Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
solarized-dark
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
native
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
inkpot
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
fruity
fromtypingimport Iterator # This is an example classMath: @staticmethod deffib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")
vim
from typing import Iterator # This is an example classMath: @staticmethod def fib(n: int) -> Iterator[int]: """Fibonacci series up to n.""" a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}")