1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

Add a visual bell to TerminalWidget. Also backspace.

This commit is contained in:
Andreas Kling 2018-10-12 20:05:11 +02:00
parent 20a1795218
commit fb4ae12bc2
4 changed files with 82 additions and 14 deletions

View file

@ -5,3 +5,24 @@ Color::Color(byte r, byte g, byte b)
{
m_value = SDL_MapRGB(FrameBufferSDL::the().surface()->format, r, g, b);
}
Color::Color(NamedColor named)
{
struct {
byte r;
byte g;
byte b;
} rgb;
switch (named) {
case Black: rgb = { 0, 0, 0 }; break;
case White: rgb = { 255, 255, 255 }; break;
case Red: rgb = { 255, 0, 0}; break;
case Green: rgb = { 0, 255, 0}; break;
case Blue: rgb = { 0, 0, 255}; break;
default: ASSERT_NOT_REACHED(); break;
}
m_value = SDL_MapRGB(FrameBufferSDL::the().surface()->format, rgb.r, rgb.g, rgb.g);
}