aboutsummaryrefslogtreecommitdiff
path: root/pyfarbpracht/printc.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyfarbpracht/printc.py')
-rwxr-xr-xpyfarbpracht/printc.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/pyfarbpracht/printc.py b/pyfarbpracht/printc.py
new file mode 100755
index 0000000..3ac38a2
--- /dev/null
+++ b/pyfarbpracht/printc.py
@@ -0,0 +1,30 @@
+#!/bin/env python3
+
+import sys
+import pyfarbpracht as fp
+
+def usage():
+ print('usage: ' + sys.argv[0] + ' \"#abcdef\" msg')
+ print('You need to escape the hex color')
+ sys.exit(1)
+
+if len(sys.argv) < 2:
+ usage()
+
+color = sys.argv[1]
+if not color.startswith('#'):
+ print('Color does not start with "#"')
+ sys.exit(1)
+if len(color) != 7:
+ print('Invalid color length')
+ sys.exit(1)
+
+try:
+ test = int(color[1:], 16)
+except:
+ print('Color is not a valid hex string')
+ sys.exit(1)
+
+msg = sys.argv[2]
+
+fp.printc(color, msg, enable_color=True)
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa