changeset 106:205767356d2c

Add two helper functions to GCMColor class.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Oct 2016 16:37:09 +0300
parents 481cfea49e19
children 7677c4992381
files multimerge.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/multimerge.py	Mon Oct 17 15:16:15 2016 +0300
+++ b/multimerge.py	Mon Oct 17 16:37:09 2016 +0300
@@ -185,6 +185,12 @@
         else:
             gcm_fatal(u"Invalid initializer for GCMColor() object.")
 
+    def to_hexrgb():
+        return "{0:02X}{1:02X}{2:02X}".format(self.r, self.g, self.b)
+
+    def to_hexrgb_lc():
+        return "{0:02x}{1:02x}{2:02x}".format(self.r, self.g, self.b)
+
     def delta(self, other):
         ctmp = GCMColor()
         ctmp.r = other.r - self.r