def print_game(self): print(bg256("blue", "Current Player: " + self.player_curent)) print(bg256("red", self.message)) self.message = "" self.print_board()
from terminaltables import SingleTable from fabulous.color import bold, bg256, fg256 print(bold('ana are text bold'), 'dar si text normal') print(bg256('#DDD', 'dar si text pe fundal gri')) data = [['X', 'O', 'X'], [' ', 'O', ' '], ['X', ' ', ' ']] table = SingleTable(data) table.inner_row_border = True print(table.table)
def colour(max, i): out = "%02d" % i value = i * (len(colours) / max) return str(fg256("#000", bg256(colours[value], out)))
def print_color(r, g, b): pad = ' ' pad2 = ' ' print bold( bg256('#%.2x%.2x%.2x' % (r, g, b), '%s' % pad + ' #%.2x%.2x%.2x ' % (r, g, b) + '%s' % pad2))
def print_color(r, g, b): pad = " " pad2 = " " print bold(bg256("#%.2x%.2x%.2x" % (r, g, b), "%s" % pad + " #%.2x%.2x%.2x " % (r, g, b) + "%s" % pad2))