X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ Other patches (grep for "patch" in ChangeLog) by:
Ismael Luceno
Thomas Karpiniec
Svante Kvarnström
Ailin Nemui (Nei)
Tom Feist (shabble)
16 changes: 16 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ AC_ARG_ENABLE(dane,
fi,
want_dane=no)

AC_ARG_ENABLE(true-color,
[ --enable-true-color Build with true color support in terminal],
if test x$enableval = xno ; then
want_truecolor=no
else
want_truecolor=yes
fi,
want_truecolor=no)

dnl **
dnl ** SSL Library checks (OpenSSL)
dnl **
Expand Down Expand Up @@ -643,6 +652,12 @@ if test "x$want_dane" = "xyes"; then
fi
fi

if test "x$want_truecolor" = "xyes" -a "x$want_termcap" != "xyes" -a "x$want_terminfo" = "xyes" ; then
AC_DEFINE([TERM_TRUECOLOR], [], [true color support in terminal])
else
want_truecolor=no
fi

AC_CONFIG_FILES([
Makefile
src/Makefile
Expand Down Expand Up @@ -761,6 +776,7 @@ echo "Building with SSL support ........ : $have_openssl"
echo "Building with 64bit DCC support .. : $offt_64bit"
echo "Building with garbage collector .. : $have_gc"
echo "Building with DANE support ....... : $have_dane"
echo "Building with true color support.. : $want_truecolor"

echo
echo "If there are any problems, read the INSTALL file."
2 changes: 2 additions & 0 deletions docs/formats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
%| Marks the indentation position
%# Monospace font on/off (useful with lists and GUI)
%% A single %
%XAB %xAB Color from extended plane (A=1-7, B=0-Z)
%ZAABBCC %zAABBCC HTML color (in hex notation)

In .theme files %n works a bit differently. See default.theme
for more information.
Expand Down
1 change: 1 addition & 0 deletions irssi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ aliases = {
CHAT = "dcc chat";
RUN = "SCRIPT LOAD";
CALC = "exec - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi";
CUBES = "/script exec Irssi::active_win->print(\"%_bases\", MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print( do { join '', map { \"%x0\\${_}0\\$_\" } '0'..'9','A'..'F' }, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print(\"%_cubes\", MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print( do { my \\$y = \\$_*6 \\; join '', map { my \\$x = \\$_ \\; map { \"%x\\$x\\$_\\$x\\$_\" } @{['0'..'9','A'..'Z']}[\\$y .. \\$y+5] } 1..6 }, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) for 0..5 \\; Irssi::active_win->print(\"%_grays\", MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print( do { join '', map { \"%x7\\${_}7\\$_\" } 'A'..'X' }, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print(\"%_mIRC extended colours\", MSGLEVEL_CLIENTCRAP) \\; my \\$x \\; \\$x .= sprintf \"\00399,%02d%02d\",\\$_,\\$_ for 0..15 \\; Irssi::active_win->print(\\$x, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) \\; for my \\$z (0..6) { my \\$x \\; \\$x .= sprintf \"\00399,%02d%02d\",\\$_,\\$_ for 16+(\\$z*12)..16+(\\$z*12)+11 \\; Irssi::active_win->print(\\$x, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) }";
SBAR = "STATUSBAR";
INVITELIST = "mode $C +I";
Q = "QUERY";
Expand Down
57 changes: 57 additions & 0 deletions src/fe-common/core/fe-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,63 @@ static void window_print_daychange(WINDOW_REC *window, struct tm *tm)
printtext_string_window(window, MSGLEVEL_NEVER, str);
}

short color_24bit_256 (const unsigned char rgb[])
{
static const int cstep_size = 40;
static const int cstep_start = 0x5f;

static const int gstep_size = 10;
static const int gstep_start = 0x08;

int dist[3] = {0};
int r[3], gr[3];

size_t i;

for (i = 0; i < 3; ++i) {
const int n = rgb[i];
gr[i] = -1;
if (n < cstep_start /2) {
r[i] = 0;
dist[i] = -cstep_size/2;
}
else {
r[i] = 1+((n-cstep_start + cstep_size /2)/cstep_size);
dist[i] = ((n-cstep_start + cstep_size /2)%cstep_size - cstep_size/2);
}
if (n < gstep_start /2) {
gr[i] = -1;
}
else {
gr[i] = ((n-gstep_start + gstep_size /2)/gstep_size);
}
}
if (r[0] == r[1] && r[1] == r[2] &&
4*abs(dist[0]) < gstep_size && 4*abs(dist[1]) < gstep_size && 4*abs(dist[2]) < gstep_size) {
/* skip gray detection */
}
else {
const int j = r[1] == r[2] ? 0 : 1;
if ((r[0] == r[1] || r[j] == r[2]) && abs(r[j]-r[(j+1)%3]) <= 1) {
const int k = gr[1] == gr[2] ? 0 : 1;
if ((gr[0] == gr[1] || gr[k] == gr[2]) && abs(gr[k]-gr[(k+1)%3]) <= 2) {
if (gr[k] < 0) {
r[0] = r[1] = r[2] = 0;
}
else if (gr[k] > 23) {
r[0] = r[1] = r[2] = 5;
}
else {
r[0] = 6;
r[1] = (gr[k] / 6);
r[2] = gr[k]%6;
}
}
}
}
return 16 + r[0]*36 + r[1] * 6 + r[2];
}

static void sig_print_text(void)
{
GSList *tmp;
Expand Down
2 changes: 2 additions & 0 deletions src/fe-common/core/fe-windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@ void window_bind_remove_unsticky(WINDOW_REC *window);
void windows_init(void);
void windows_deinit(void);

short color_24bit_256(const unsigned char rgb[]);

#endif
Loading
X Tutup