Skip to content

Commit

Permalink
Merge 15438dc into 555761f
Browse files Browse the repository at this point in the history
  • Loading branch information
parhamfh committed Sep 6, 2017
2 parents 555761f + 15438dc commit 94a06aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions httpie/output/formatters/colors.py
@@ -1,5 +1,6 @@
from __future__ import absolute_import
import json
import random

import pygments.lexer
import pygments.token
Expand All @@ -18,6 +19,7 @@

AVAILABLE_STYLES = set(pygments.styles.STYLE_MAP.keys())
AVAILABLE_STYLES.add('solarized')
AVAILABLE_STYLES.add('random')

# This is the native style provided by the terminal emulator color scheme
PRESET_STYLE = 'preset'
Expand Down Expand Up @@ -51,6 +53,9 @@ def __init__(self, env, explicit_json=False,
# --json, -j
self.explicit_json = explicit_json

if color_scheme == 'random':
color_scheme = random.choice(list(pygments.styles.STYLE_MAP.keys()))

try:
style_class = pygments.styles.get_style_by_name(color_scheme)
except ClassNotFound:
Expand Down

0 comments on commit 94a06aa

Please sign in to comment.