Bump version to 0.1.1 and add font color option

This commit is contained in:
2025-02-03 14:33:32 +03:00
parent 7c2ab9654e
commit 89f83c28a7
9 changed files with 3826 additions and 8 deletions

View File

@@ -21,6 +21,7 @@ pub struct Knob<'a> {
stroke_width: f32,
knob_color: Color32,
line_color: Color32,
text_color: Color32,
label: Option<String>,
label_position: LabelPosition,
style: KnobStyle,
@@ -37,6 +38,7 @@ impl<'a> Knob<'a> {
stroke_width: 2.0,
knob_color: Color32::GRAY,
line_color: Color32::GRAY,
text_color: Color32::WHITE,
label: None,
label_position: LabelPosition::Bottom,
style,
@@ -58,9 +60,15 @@ impl<'a> Knob<'a> {
self
}
pub fn with_colors(mut self, knob_color: Color32, line_color: Color32) -> Self {
pub fn with_colors(
mut self,
knob_color: Color32,
line_color: Color32,
text_color: Color32,
) -> Self {
self.knob_color = knob_color;
self.line_color = line_color;
self.text_color = text_color;
self
}
@@ -143,7 +151,7 @@ impl Widget for Knob<'_> {
Align2::LEFT_TOP,
label_text,
font_id,
Color32::WHITE,
self.text_color,
);
}