mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibWeb/CSS: Implement the color-scheme CSS property
This commit is contained in:
parent
89296b88a0
commit
ce5cd012b9
Notes:
github-actions[bot]
2025-01-08 11:19:41 +00:00
Author: https://github.com/Gingeh
Commit: ce5cd012b9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3146
Reviewed-by: https://github.com/AtkinsSJ ✅
36 changed files with 618 additions and 370 deletions
|
@ -72,10 +72,8 @@ void CheckBoxPaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
auto checkbox_rect = context.enclosing_device_rect(absolute_rect()).to_type<int>();
|
||||
auto checkbox_radius = checkbox_rect.width() / 5;
|
||||
|
||||
auto& palette = context.palette();
|
||||
|
||||
auto shade = [&](Color color, float amount) {
|
||||
return InputColors::get_shade(color, amount, palette.is_dark());
|
||||
return InputColors::get_shade(color, amount, computed_values().color_scheme());
|
||||
};
|
||||
|
||||
auto modify_color = [&](Color color) {
|
||||
|
@ -84,7 +82,7 @@ void CheckBoxPaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
return color;
|
||||
};
|
||||
|
||||
auto input_colors = compute_input_colors(palette, computed_values().accent_color());
|
||||
auto input_colors = compute_input_colors(computed_values().color_scheme(), computed_values().accent_color());
|
||||
|
||||
auto increase_contrast = [&](Color color, Color background) {
|
||||
auto constexpr min_contrast = 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue