|
mAdM0nK Beginner
Joined: 17 Apr 2001 Posts: 14 Location: USA
|
Posted: Thu Feb 12, 2004 1:00 am
color help |
ok, im probably just being retarded here, but is there anyway to take $ansi(color) codes like, %ansi(high,red), put them into something like %colorname and get the hex code for $ansi color. and then take that hex code and use it in place of $ansi(colorhere)
basically im trying to replace all my %ansi(color) statements with whatever the replacement would be using just RGB hex codes, but i cant find what will actually put the hex code back into the mud as easily as %ansi will. |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Thu Feb 12, 2004 5:10 am |
as far as I know ther is no way to get the BGR codes, you pretty much have to make a list of your own.
This is what i did to give me a small idea of what i was up against.
#alias co {#loop 1,%1 {#show %ansi(%i)Hello}}
I did small groups at a time like:
1- 100
100 - 500
500- 1000
1000 -2000 etc.......... |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Feb 12, 2004 7:00 pm |
Approximate values:
$000000 black
$000080 blue
$00A000 green
$008080 cyan
$800000 red
$800080 magenta
$808000 brown
$C0C0C0 gray
$808080 hi,black
$0000FF hi,blue
$00FF00 hi,green
$00FFFF hi,cyan
$FF0000 hi,red
$FF00FF hi,magenta
$FFFF00 hi,brown (yellow)
$FFFFFF hi,gray (white) |
|
|
|
mAdM0nK Beginner
Joined: 17 Apr 2001 Posts: 14 Location: USA
|
Posted: Fri Feb 13, 2004 1:16 am |
yeah, but how can i use those in say an alias
for example
right now ive got a chat alias that goes like this
#alias ca {#chatall %ansi( reset)"["%ansi( high, green)@HPCurrent%ansi( reset)"/"%ansi( high, cyan)@manaCurrent%ansi( reset)"]" %case( %random( 1, 4), %ansi( high, blue), %ansi( high, yellow), %ansi( high, red), %ansi( white))%-1%ansi( reset)}
how would i take those RGB values and replace all the %ansi(whatever) parts
would it still be %ansi( just with the hex values and $ sign
like %ansi($00FF00)
or would it be some other preset variable that id have to use? |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Feb 13, 2004 2:08 am |
Straight substitution from what Lightbulb posted?
#alias ca {#chatall %ansi( reset)"["%ansi($00FF00)@HPCurrent%ansi( reset)"/"%ansi($00FFFF)@manaCurrent%ansi( reset)"]" %case( %random( 1, 4), %ansi($0000FF), %ansi($FFFF00), %ansi($FF0000), %ansi($FFFFFF))%-1%ansi( reset)} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Feb 13, 2004 9:52 am |
The %ansi function doesn't recognize RGB values. It's limited to 16 foreground colors, 8 background colors, and several attributes. They can all be referred to by name: %ansi( blink,under,hi,red) with no need to convert them to any kind of number. However, the %ansi function is intended to alter the zMUD displa. It's not for sending codes to the MUD.
Every MUD has its own way of handling color. To find out how to send color commands to your MUD, you will have to read the documentation for the MUD. I gave you the approximate RGB values, but how to send them to your MUD is something you'll have to discover for yourself.
#CHATALL isn't a recognized zMUD command. It's probably from the zChat plugin. If that's the case, you should read the documentation (help) on zChat to find out how to send colors to it. I don't use it and can't give you any advice. However, since it's written for use with zMUD, there's a good chance you can just use the standard %ansi() function and don't have any need to change it to RGB. |
|
|
|
mAdM0nK Beginner
Joined: 17 Apr 2001 Posts: 14 Location: USA
|
Posted: Tue Feb 17, 2004 12:53 am |
yeah thats what i was thinking b/c the mud doesnt recognize the rgb values, when i just tried it, so its gotta be something with zchat
|
|
|
|
mAdM0nK Beginner
Joined: 17 Apr 2001 Posts: 14 Location: USA
|
Posted: Tue Feb 17, 2004 1:38 am |
its not really for sending color to the mud either, its for sending it from zchat to MM, but MM doesnt recognize the %ansi coloration, but it will recognize colors that are set using the RGB values. and thats why i was trying to figure out how to send different colored text through zchat. but thats probably a different forum eh?
|
|
|
|
mAdM0nK Beginner
Joined: 17 Apr 2001 Posts: 14 Location: USA
|
Posted: Tue Feb 17, 2004 6:05 am |
well i finally figured out the color thing b/w zchat and MM now, but they one thing i cant make work is bolding or highlighting the colors, anyone know the numerical value of %ansi(bold) or %ansi(high), it keeps coming up as 8 when i do #show %color(high), and #show %color(bold) as 128, and those dont make the colors bold or high
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Feb 17, 2004 6:21 pm |
8 is the correct number for high. The normal ANSI colors are 0-7. The "high" colors are 8-15.
|
|
|
|
|
|