mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 19:08:05 +08:00
MVP eyedropper tool for fill colors (#300)
* Implement eyedropper for layer fill colors * Add shortcut for eyedropper * Add right mouse sampling for secondary color
This commit is contained in:
committed by
Keavon Chambers
parent
03c5847d7e
commit
7d3239ecac
@@ -19,6 +19,9 @@ impl Fill {
|
||||
pub fn new(color: Color) -> Self {
|
||||
Self { color: Some(color) }
|
||||
}
|
||||
pub fn color(&self) -> Option<Color> {
|
||||
self.color
|
||||
}
|
||||
pub fn none() -> Self {
|
||||
Self { color: None }
|
||||
}
|
||||
@@ -41,6 +44,12 @@ impl Stroke {
|
||||
pub fn new(color: Color, width: f32) -> Self {
|
||||
Self { color, width }
|
||||
}
|
||||
pub fn color(&self) -> Color {
|
||||
self.color
|
||||
}
|
||||
pub fn width(&self) -> f32 {
|
||||
self.width
|
||||
}
|
||||
pub fn render(&self) -> String {
|
||||
format!(r##" stroke="#{}"{} stroke-width="{}""##, self.color.rgb_hex(), format_opacity("stroke", self.color.a()), self.width)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user