# HG changeset patch # User Paul Boddie # Date 1345316542 -7200 # Node ID e08d1dc30990db29bfbe0babe571ea9bbda98155 # Parent 29751a5f24af61f8e9b5ade8a57c9d0de324e128 Moved colour-related functions to a MoinSupport module. diff -r 29751a5f24af -r e08d1dc30990 EventAggregatorSupport.py --- a/EventAggregatorSupport.py Tue Jul 17 00:42:39 2012 +0200 +++ b/EventAggregatorSupport.py Sat Aug 18 21:02:22 2012 +0200 @@ -12,6 +12,7 @@ from MoinDateSupport import * from MoinRemoteSupport import * from MoinSupport import * +from ViewSupport import * from MoinMoin.Page import Page from MoinMoin.action import AttachFile @@ -1410,24 +1411,6 @@ except IndexError: return None -# Colour-related functions. - -def getColour(s): - colour = [0, 0, 0] - digit = 0 - for c in s: - colour[digit] += ord(c) - colour[digit] = colour[digit] % 256 - digit += 1 - digit = digit % 3 - return tuple(colour) - -def getBlackOrWhite(colour): - if sum(colour) / 3.0 > 127: - return (0, 0, 0) - else: - return (255, 255, 255) - # User interface abstractions. class View: