Table of Contents
DecafBland, a Colloquy style
A chat style for Colloquy without many frills, though it does have a nifty technique used to implement nick coloring. For the most part, I think this style has been taken over by Colloquy developers—which is fine by me.
Downloads
The latest version of files, with possible corrections or additions, can be seen here:
Background
I wanted a chat style to use in Colloquy that didn't have much fancy design or imagery going on. The out-of-box "Bland" style satisfied me mostly, but I missed the way other IRC clients assigned a different color coding for each nick in a channel. This helps quickly identify speakers at a glance.
The clever bit about it stems from a hashing algorithm I implemented in XSL which converts any string (such as a nick) into a number within a given range (such as a index on a list of colors).
Here's the gist, in code:
<xsl:variable name="senderNick" select="sender | ../sender"/>
<xsl:variable name="senderHash"
select="number(translate($senderNick,
'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM-_',
'123456789012345678901234567890123456789012345678901234'
))"
/>
<xsl:variable name="senderColor">
<xsl:choose>
<xsl:when test="sender/@self = 'yes'">colorself</xsl:when>
<xsl:when test="../sender/@self = 'yes'">colorself</xsl:when>
<xsl:when test="string-length(sender/text()) > 0">
<xsl:value-of select="concat('color', $senderHash mod 15)" />
</xsl:when>
</xsl:choose>
</xsl:variable>
<span id="{@id}" class="{$senderClasses} {$senderColor}">
Latest Versions
Here's a list of up-to-date resources, as they sit in version control:
