zed/crates/gpui/examples
Jason Lee de89f8cf83
gpui: Add linear gradient support to fill background (#20812)
Release Notes:

- gpui: Add linear gradient support to fill background

Run example:

```
cargo run -p gpui --example gradient
cargo run -p gpui --example gradient --features macos-blade
```

## Demo

In GPUI (sRGB):

<img width="761" alt="image"
src="https://github.com/user-attachments/assets/568c02e8-3065-43c2-b5c2-5618d553dd6e">

In GPUI (Oklab):

<img width="761" alt="image"
src="https://github.com/user-attachments/assets/b008b0de-2705-4f99-831d-998ce48eed42">

In CSS (sRGB): 

https://codepen.io/huacnlee/pen/rNXgxBY

<img width="505" alt="image"
src="https://github.com/user-attachments/assets/239f4b65-24b3-4797-9491-a13eea420158">

In CSS (Oklab):

https://codepen.io/huacnlee/pen/wBwBKOp

<img width="658" alt="image"
src="https://github.com/user-attachments/assets/56fdd55f-d219-45de-922f-7227f535b210">


---

Currently only support 2 color stops with linear-gradient. I think this
is we first introduce the gradient feature in GPUI, and the
linear-gradient is most popular for use. So we can just add this first
and then to add more other supports.
2024-12-11 21:52:52 +02:00
..
image gpui: Fix SVG color render, when color have alpha (#20537) 2024-11-16 16:53:57 +02:00
svg
animation.rs
gif_viewer.rs Add Loading and Fallback States to Image Elements (via StyledImage) (#20371) 2024-11-15 19:12:01 -08:00
gradient.rs gpui: Add linear gradient support to fill background (#20812) 2024-12-11 21:52:52 +02:00
hello_world.rs gpui: Fix default colors blue, red, green to match in CSS default colors (#20851) 2024-11-28 10:08:07 +02:00
image_loading.rs Add Loading and Fallback States to Image Elements (via StyledImage) (#20371) 2024-11-15 19:12:01 -08:00
input.rs Clip UTF-16 offsets in text for range (#20968) 2024-11-20 22:04:26 -07:00
opacity.rs
ownership_post.rs
painting.rs gpui: Add paint_path example (#20499) 2024-11-16 13:36:13 +02:00
set_menus.rs
shadow.rs
text_wrapper.rs
uniform_list.rs
window.rs gpui: Fix hide, activate method on Windows to hide/show application (#18164) 2024-09-30 23:20:24 -07:00
window_positioning.rs
window_shadow.rs