ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.96k stars 420 forks source link

RGBA's Alpha not work in alacritty #906

Closed dty2 closed 3 months ago

dty2 commented 3 months ago

rgba not work my code is

...
    return false;
  });
  //this->content = emain;
  this->content = Renderer([](bool focused){ return text("hello") | bgcolor(Color::RGBA(21, 101, 192, 130)); });
  std::thread t([&]{
    function->postevent = std::bind(&Tui::postevent, this, std::placeholders::_1);
    function->start();
  });
  screen->Loop(content);
...

when I set "a" is 130, the result is 2024-07-25_23-24 when I set "a" is 110, the result is 2024-07-25_23-25 I notice that the max of alpha is 255,. the min of alpha is 0 so I get the result is when I set alpha less than 126, it is not transparent, and when I set alpha more than 127, it is thorough transparent I don't want it thorough, I want make it translucence. So, Am I mistaken? Or, something was wrong... I think it is my terminal problem, so will I try to install other terminal to try again...

dty2 commented 3 months ago

I think I found the problem... it is my alacritty. I set alacirtty transparent, but alacirtty not transparent for text, it just transparent for background. (such as nvim, it is not transparent too...) So, the Color::RGBA not work. I don't know the bottom the render rule and code. I think something must be changed...

dty2 commented 3 months ago

I try some other terminal like kitty. I set kitty transparent 0.8 and run my code. RGBA still not work... What terminal does author use? I want to try again...

ArthurSonzogni commented 3 months ago

Hello, Terminals do not support an alpha channel. The transparency we expect from FTXUI is when stacking multiple elements on top of each other using dbox.