java - Detecting IRC colors within a String -
how can go detecting irc color codes within string?
here's i've tried:
int length = message.length(); arraylist<object> buffer = new arraylist<object>(); (int = 0; < length; i++) { char ch = message.charat(i); if (character.isdefined(ch) && !character.isletter(ch)) { methods.log("val " + (int) ch);//attempt logging irc color value } else { buffer.add(ch); } } however failed. i'm writing irc client grade 11 programming class , figured colors cool feature add.
the irc colors "specified" mirc -- it's complicated, , not clients interpret specification same way -- you're looking ^c "control character" (0x03) followed digits describe specific foreground , background colors use.
once you've found them in stream of text you'll need figure out how change text color on text widgets and remember set text normal before next message output.
Comments
Post a Comment