樣式
Pygments 內建以下樣式。關於樣式的更多資訊,請參閱文件。
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
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}")
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
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}")
monokai
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}")
lightbulb
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}")
github-dark
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}")
rrt
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}")
對比度較低的樣式
以下樣式未達到WCAG 2.1 AA 最低對比度標準,因此對於視力不佳的人來說可能難以閱讀。如果您希望您高亮顯示的程式碼能夠讓其他人容易閱讀,您應該使用較早的樣式。
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
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}")
borland
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}")
colorful
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}")
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
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}")
murphy
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}")
pastie
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}")
rainbow_dash
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}")
stata-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}")
trac
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}")
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
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}")
tango
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}")
solarized-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}")
manni
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}")
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
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_grayscale
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}")
perldoc
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}")
paraiso-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}")
zenburn
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}")
nord
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}")
material
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}")
one-dark
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}")
dracula
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}")
nord-darker
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}")
gruvbox-dark
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}")
stata-dark
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}")
paraiso-dark
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}")
coffee
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}")
solarized-dark
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}")
native
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}")
inkpot
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}")
fruity
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}")
vim
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}")