![]() This PR cleans up some color & elevation misc. ### Don't allow deriving Color from Hsla The point of the [ui::Color] enum is to encourage consistent color usage, and the the Color::Custom case is really only meant for cases where we have no other choice. `impl From<Hsla> for Color` encourages blindly passing colors into `Color::Custom` – with this in place we might as well remove the entire `Color` enum. The usages that were updated due to this removal were for colors that already exist in the Color enum, making it even more clear that it didn't make sense to have this. ### `ElevationIndex` -> `Elevation` This name would make more sense if we had an `Elevation` in the first place. The new name is more clear. #### `Button::elevation` As part of this change I also updated button's `layer` method to `elevation`, since it takes an elevation. This method still has the following issue: You want to use `Button::elevation` when it's default colors are invisible on the layer you are rendering the button on. However, current this method uses the elevation's `bg` color, rather than it's `on_elevation_bg`. Ideally when you use `Button::elevation` you want to pass the elevation you are _on_, not choosing one that will show up the elevation you are on. This change will be in a separate PR, as it likely will have widespread visual impact across the app. Release Notes: - N/A |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-GPL |