zed/crates/gpui/examples
Jason Lee e9e260776b
gpui: Fix default colors blue, red, green to match in CSS default colors (#20851)
Release Notes:

- N/A

---

This change to let the default colors to 100% match with CSS default
colors.

And update the methods to as `const`.

Here is an example:

<img width="338" alt="image"
src="https://github.com/user-attachments/assets/dd17b46a-3ad4-4122-8dca-e800644c75b0">

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

But the before version for example blue: `h: 0.6 * 360 = 216`, but we
expected `240`, `240 / 360 = 0.666666666`, so the before version are
lose the precision. (Here is a test tool: https://hslpicker.com/#0000FF)

## After Update

```bash
cargo run -p gpui --example hello_world
```

<img width="612" alt="image"
src="https://github.com/user-attachments/assets/97d479d8-9c71-4be3-95e0-09af45fe47e2">
2024-11-28 10:08:07 +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
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
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
window_positioning.rs
window_shadow.rs