mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Split out ecolor crate (#2399)
* split out ecolor crate * split up ecolor crate in lots of modules * add changelog notes * add readme to ecolor * put clippy::manual_range_contains on cranky allow list * fix hex color issues * doc fixes * more hex_color fixes * Document features * Rename hex_color module to avoid warning * Sort the feature names * fix link in CHANGELOG.md * better wording Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
@@ -328,17 +328,19 @@ pub mod widgets;
|
||||
pub use accesskit;
|
||||
|
||||
pub use epaint;
|
||||
pub use epaint::ecolor;
|
||||
pub use epaint::emath;
|
||||
|
||||
pub use emath::{lerp, pos2, remap, remap_clamp, vec2, Align, Align2, NumExt, Pos2, Rect, Vec2};
|
||||
#[cfg(feature = "color-hex")]
|
||||
pub use epaint::hex_color;
|
||||
pub use ecolor::hex_color;
|
||||
pub use ecolor::{Color32, Rgba};
|
||||
pub use emath::{lerp, pos2, remap, remap_clamp, vec2, Align, Align2, NumExt, Pos2, Rect, Vec2};
|
||||
pub use epaint::{
|
||||
color, mutex,
|
||||
mutex,
|
||||
text::{FontData, FontDefinitions, FontFamily, FontId, FontTweak},
|
||||
textures::{TextureFilter, TextureOptions, TexturesDelta},
|
||||
ClippedPrimitive, Color32, ColorImage, FontImage, ImageData, Mesh, PaintCallback,
|
||||
PaintCallbackInfo, Rgba, Rounding, Shape, Stroke, TextureHandle, TextureId,
|
||||
ClippedPrimitive, ColorImage, FontImage, ImageData, Mesh, PaintCallback, PaintCallbackInfo,
|
||||
Rounding, Shape, Stroke, TextureHandle, TextureId,
|
||||
};
|
||||
|
||||
pub mod text {
|
||||
|
||||
@@ -448,6 +448,6 @@ impl Painter {
|
||||
|
||||
fn tint_shape_towards(shape: &mut Shape, target: Color32) {
|
||||
epaint::shape_transform::adjust_colors(shape, &|color| {
|
||||
*color = crate::color::tint_color_towards(*color, target);
|
||||
*color = crate::ecolor::tint_color_towards(*color, target);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#![allow(clippy::if_same_then_else)]
|
||||
|
||||
use crate::{color::*, emath::*, FontFamily, FontId, Response, RichText, WidgetText};
|
||||
use crate::{ecolor::*, emath::*, FontFamily, FontId, Response, RichText, WidgetText};
|
||||
use epaint::{Rounding, Shadow, Stroke};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
@@ -495,7 +495,7 @@ impl Visuals {
|
||||
}
|
||||
|
||||
pub fn weak_text_color(&self) -> Color32 {
|
||||
crate::color::tint_color_towards(self.text_color(), self.window_fill())
|
||||
crate::ecolor::tint_color_towards(self.text_color(), self.window_fill())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
@@ -6,7 +6,7 @@ use std::sync::Arc;
|
||||
use epaint::mutex::{RwLock, RwLockReadGuard, RwLockWriteGuard};
|
||||
|
||||
use crate::{
|
||||
color::*, containers::*, epaint::text::Fonts, layout::*, menu::MenuState, placer::Placer,
|
||||
containers::*, ecolor::*, epaint::text::Fonts, layout::*, menu::MenuState, placer::Placer,
|
||||
widgets::*, *,
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::util::fixed_cache::FixedCache;
|
||||
use crate::*;
|
||||
use epaint::{color::*, *};
|
||||
use epaint::{ecolor::*, *};
|
||||
|
||||
fn contrast_color(color: impl Into<Rgba>) -> Color32 {
|
||||
if color.into().intensity() < 0.5 {
|
||||
|
||||
@@ -7,8 +7,8 @@ use std::{
|
||||
};
|
||||
|
||||
use crate::*;
|
||||
use epaint::color::Hsva;
|
||||
use epaint::util::FloatOrd;
|
||||
use epaint::Hsva;
|
||||
|
||||
use items::PlotItem;
|
||||
use legend::LegendWidget;
|
||||
|
||||
Reference in New Issue
Block a user