|
From: | Asger Ottar Alstrup |
Subject: | Re: [Monotone-devel] Re: New release of monotone-viz |
Date: | Sat, 11 Dec 2004 17:39:42 +0100 |
User-agent: | Mozilla Thunderbird 1.0 (Windows/20041206) |
Christof Petig wrote:
PS: Considering auto colorizing: What about hashing branch and/or author with sha1 and take the first three bytes as R,G and B. Most likely you have to switch the _text_ color to white once e.g. max(R,G,B)<128 or R+G+B<255. This might be a bit psychedelic but should give distinct enough and stable enough colors.
Since the RGB color space is not tuned to match the human eye, you will get much better results using this formula:
int luminance = 0.3 * red + 0.59 * green + 0.11 * blue; if (luminance < 128) { // Choose white } else { // Choose black } For more details, see for instance http://www.scantips.com/lumin.html Regards, Asger Ottar Alstrup
[Prev in Thread] | Current Thread | [Next in Thread] |