Add the color crate (#4063)

This PR adds the `color` crate, which will be the home of a number of
color-related utilities, and also acts as an interface between
[`palette`](https://crates.io/crates/palette) and the way `gpui` colors
work.

The goal of this crate is to centralize color utilities like mixing and
blending, building color ramps and sets of colors for state and more.

## Todo:

- [x] hex -> Color
- [x] Color mixing
- [x] Color blending using blend modes (overlay, multiply, etc)
- [ ] ~~Build color ramp from color~~
- [x] Build state set from color
- [ ] ~~Update Theme to use the color crate~~

Release Notes:

- None (Internal changes: Adds the `color` crate for working with
colors.)
This commit is contained in:
Nate Butler 2024-01-17 11:47:23 -05:00 committed by GitHub
commit 19c488b378
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 343 additions and 2 deletions

View file

@ -34,6 +34,7 @@ story = { path = "../story", optional = true }
toml.workspace = true
uuid.workspace = true
util = { path = "../util" }
color = {path = "../color"}
itertools = { version = "0.11.0", optional = true }
[dev-dependencies]