Merge branch 'master' into wgpu/better-architecture
This commit is contained in:
commit
13289dbd19
41 changed files with 318 additions and 267 deletions
|
|
@ -10,6 +10,9 @@ homepage.workspace = true
|
|||
categories.workspace = true
|
||||
keywords.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
auto-detect-theme = ["dep:dark-light"]
|
||||
advanced = []
|
||||
|
|
|
|||
|
|
@ -9,13 +9,6 @@
|
|||
#![doc(
|
||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||
)]
|
||||
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||
#![deny(
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
unused_results,
|
||||
rustdoc::broken_intra_doc_links
|
||||
)]
|
||||
pub mod alignment;
|
||||
pub mod border;
|
||||
pub mod clipboard;
|
||||
|
|
|
|||
|
|
@ -612,11 +612,19 @@ fn mix(a: Color, b: Color, factor: f32) -> Color {
|
|||
|
||||
fn readable(background: Color, text: Color) -> Color {
|
||||
if is_readable(background, text) {
|
||||
text
|
||||
} else if is_dark(background) {
|
||||
return text;
|
||||
}
|
||||
|
||||
let fallback = if is_dark(background) {
|
||||
Color::WHITE
|
||||
} else {
|
||||
Color::BLACK
|
||||
};
|
||||
|
||||
if is_readable(background, fallback) {
|
||||
fallback
|
||||
} else {
|
||||
fallback.inverse()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue