larsbrinkhoff / terminal-simulator

Simulation of VT52 and VT100 terminal hardware.
GNU General Public License v3.0
113 stars 17 forks source link

Is there a way to change the color of the text? #42

Closed ronaldlw closed 1 year ago

ronaldlw commented 1 year ago

Can we make a green or amber monitor?

larsbrinkhoff commented 1 year ago

That should be quite easy. But I'm rather pressed for time now, so I'm looking for contributors to submit a pull request.

ronaldlw commented 1 year ago

i found that by twiddling with this line I was able to change to amber and green: https://github.com/larsbrinkhoff/terminal-simulator/blob/d5e3ae99850865ccf52c7285d32eedc89442df63/vt100/render.c#L53

u32 x = data->brightness; x = 255 * (31 - (x & 0x1F)) / 31;

lit = x << 16 | x << 8 | x; //original, white lit = x << 16 | x 8 / 10 << 8 ; // amber lit = x << 8 | x 2 / 10 ; // green

1005221812b

larsbrinkhoff commented 1 year ago

Problem solved, then.