convert plant1c.jpeg +dither -colors 8 plant8.jpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random as r | |
import matplotlib.pyplot as plt | |
# Generate rolls | |
n_rolls = 1000000 | |
rolls = [(r.randint(1,6),r.randint(1,6)) for i in range(n_rolls)] | |
flat_list = [item for sublist in rolls for item in sublist] | |
plt.hist(flat_list,bins=12) | |
plt.show() | |
# %% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" Convert values between RGB hex codes and xterm-256 color codes. | |
Nice long listing of all 256 colors and their codes. Useful for | |
developing console color themes, or even script output schemes. | |
Resources: | |
* http://en.wikipedia.org/wiki/8-bit_color | |
* http://en.wikipedia.org/wiki/ANSI_escape_code |