1

I am a builder on an old-fasioned MUD. I have been tasked with making a web-based room/object/mobile editor. This is no problem for me, and am almost complete. The only problem I have is the colour chart. I'm not sure how to convert the ASCII colours from Lope's ColoUr system to HEX values to use in CSS.

For instance, Red is defined as:

#define C_RED       "\e[0;31m"  

I'm not sure how to change that to red in Hex to use for CSS, and which shade (there are two shades of red in lope's colour system. One dark, one light. Same for most colors).

Does anyone know of a way to convert from one to the other?

Idrizi.A
  • 9,819
  • 11
  • 47
  • 88
user1287233
  • 11
  • 1
  • 2

2 Answers2

0

Manually entering each entry would be my first guess, unless there's a pattern you can follow for the console colors.

Nick
  • 4,901
  • 40
  • 61
  • There is a pattern, but better-looking results can probably be achieved using a lookup table. – Ben Voigt Jun 01 '12 at 14:20
  • I'm hoping theres a lookup table. Worse comes to worse, i'll just screencap my mud client with the color examples, and use photoshops eyedrop tool to find the color that way. – user1287233 Jun 01 '12 at 14:32
  • Not a bad idea. If there were a way to quickly click on each one and output the color to a file, that would save a lot of time. – Nick Jun 01 '12 at 16:02
0

As I recall, there are only 10 'colours' to worry about here:

  • Red
  • Green
  • Blue
  • Cyan
  • Magenta (Purple)
  • Yellow
  • Black
  • White

Luckily, these are just the primary and secondary colours from an RGB system:

  • Red: 0xFF0000
  • Green: 0x00FF00
  • Blue: 0x0000FF
  • Cyan: 0x00FFFF
  • Magenta (Purple): 0xFF00FF
  • Yellow: 0xFFFF00
  • Black: 0x000000
  • White: 0xFFFFFF

For dark versions, try halving each byte to 7F

Dancrumb
  • 26,597
  • 10
  • 74
  • 130
  • We actually have a bit more. Here's the list from "help colour": {r red {c cyan {R red {C cyan {g green {y yellow {G green {Y yellow {b blue {w white {B blue {W white {m magenta {x clear(reset colour) {M pink {D grey {{ { char {* beep – user1287233 Jun 01 '12 at 14:31
  • Half yellow was widely futzed with as it was widely considered ugly. – Textmode Sep 18 '13 at 06:06