Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 45 lines (39 sloc) 0.924 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
/*
quIRC - simple terminal-based IRC client
Copyright (C) 2010 Edward Cree

See quirc.c for license information
colour: defined colours & mirc-colour-compat
*/

#include "colour.h"

int setcolour(colour c)
{
return(setcol(c.fore, c.back, c.hi, c.ul));
}

colour c_mirc(int fore, int back)
{
/*mIRC colours:
0=white, 1=black, 2=dk blue, 3=green, 4=red, 5=maroon, 6=purple, 7=orange, 8=yellow, 9=lt green, 10=teal, 11=cyan, 12=blue, 13=fuchsia, 14=dk gray, 15=lt gray
converted:
0->7, 1->0, 2->4, 3->2, 4->1, 5->1, 6->5, 7->3, 8->3, 9->2, 10->6, 11->6, 12->4, 13->5, 14->0(7), 15->7
*/
const int col[16]={7, 0, 4, 2, 1, 1, 5, 3, 3, 2, 6, 6, 4, 5, 0, 7};
colour rv={7, 0, false, false};
if((fore>=0) && (fore<16))
{
rv.fore=col[fore];
}
if((back>=0) && (back<16))
{
rv.back=col[back];
}
if(rv.fore==rv.back)
{
rv.fore=7-rv.back;
}
return(rv);
}

int c_init(void)
{
#include "c_init.c"
return(0);
}
Something went wrong with that request. Please try again.