GP-1981 - Theming - Version Tracking color conversion; Help css color

conversion
This commit is contained in:
dragonmacher 2022-08-22 19:24:05 -04:00 committed by ghidragon
parent 3f8096014f
commit 7c7d98090f
25 changed files with 367 additions and 142 deletions

View file

@ -6,6 +6,9 @@ color.bg.visualgraph.satellite = lightgray
color.bg.highlight.visualgraph = rgba(255,255,0,155) // somewhat transparent yellow
color.bg.visualgraph.message = rgb(138, 185, 241) // jordy blue
color.bg.visualgraph.drop.shadow.dark = black
color.bg.visualgraph.drop.shadow.light = gray
color.bg.visualgraph.satellite.vertex = color.palette.material.secondary.variant
color.fg.visualgraph.message = color.palette.black
@ -39,6 +42,9 @@ color.bg.highlight.visualgraph = rgba(120,120,120,155) // light gray with dark b
color.bg.visualgraph.message = rgb(65, 146, 242) // dark blue close to jordy blue
color.fg.visualgraph.message = color.palette.lightgray
color.bg.visualgraph.drop.shadow.dark = black
color.bg.visualgraph.drop.shadow.light = gray
color.bg.visualgraph.satellite.vertex = color.palette.material.secondary.variant
color.bg.visualgraph.dockingvertex = color.palette.material.secondary.variant

View file

@ -30,7 +30,6 @@ import edu.uci.ics.jung.visualization.transform.MutableTransformer;
import edu.uci.ics.jung.visualization.transform.MutableTransformerDecorator;
import edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator;
import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.graph.viewer.VisualEdge;
import ghidra.graph.viewer.VisualVertex;
@ -44,6 +43,10 @@ public class AbstractVisualVertexRenderer<V extends VisualVertex, E extends Visu
extends BasicVertexRenderer<V, E> {
private static final Color HIGHLIGHT_COLOR = new GColor("color.bg.highlight.visualgraph");
private static final Color DROP_SHADOW_DARK =
new GColor("color.bg.visualgraph.drop.shadow.dark");
private static final Color DROP_SHADOW_LIGHT =
new GColor("color.bg.visualgraph.drop.shadow.light");
private Function<? super V, Paint> vertexFillPaintTransformer;
@ -146,14 +149,21 @@ public class AbstractVisualVertexRenderer<V extends VisualVertex, E extends Visu
return;
}
g.setColor(Palette.GRAY);
int upperOffset = -3;
int grayOffset = 15;
int blackOffset = 5;
// the upper-offset ensures the upper and left side of the vertex are discernable when tiny
g.setColor(DROP_SHADOW_LIGHT);
AffineTransform xform3 = AffineTransform.getTranslateInstance(upperOffset, upperOffset);
Shape xShape3 = xform3.createTransformedShape(shape);
g.fill(xShape3);
AffineTransform xform = AffineTransform.getTranslateInstance(grayOffset, grayOffset);
Shape xShape = xform.createTransformedShape(shape);
g.fill(xShape);
g.setColor(Palette.BLACK);
g.setColor(DROP_SHADOW_DARK);
AffineTransform xform2 = AffineTransform.getTranslateInstance(blackOffset, blackOffset);
Shape xShape2 = xform2.createTransformedShape(shape);
g.fill(xShape2);