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 gpui: Add svg example (#17315) 2024-09-03 13:15:37 -04:00
animation.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
gif_viewer.rs Add Loading and Fallback States to Image Elements (via StyledImage) (#20371) 2024-11-15 19:12:01 -08: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 chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
ownership_post.rs
painting.rs gpui: Add paint_path example (#20499) 2024-11-16 13:36:13 +02:00
set_menus.rs gpui: Update Menu name to use SharedString type to support more types (#14791) 2024-07-19 08:51:31 -04:00
shadow.rs Adjust erf estimation function (#15423) 2024-08-07 14:12:26 +02:00
text_wrapper.rs gpui: Fix CJK line wrap for GPUI text render (#17737) 2024-09-12 15:55:03 -04:00
uniform_list.rs gpui: Add example for uniform_list (#17421) 2024-09-05 14:24:10 -04:00
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 gpui: Fix cx.bounds, cx.open_window position on macOS (#14044) 2024-07-10 09:52:33 -06:00
window_shadow.rs