MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / ColorSelector

Class ColorSelector

src/main/java/ui/controls/form/ColorSelector.java:37–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35import ui.VirtualElement;
36
37public class ColorSelector implements VirtualElement {
38
39 static Font mfont = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_SMALL);
40 Graphics G;
41 private int yTranslate;
42 public int cpos;
43 String nowcolor;
44 int red;
45 int green;
46 int blue;
47 String val;
48 public int dy;
49 private int value;
50 int paramName;
51 int ncolor;
52 private int color;
53 private int py;
54 private int ph;
55 private ColorsList list;
56 public int pxred;
57 public int pxgreen;
58 public int pxblue;
59
60 public ColorSelector(ColorsList list, int paramName) {
61
62 this.list = list;
63 this.paramName = paramName;
64
65 this.color = ColorTheme.getColor(paramName);
66
67
68 red = ColorTheme.getRed(color);
69 green = ColorTheme.getGreen(color);
70 blue = ColorTheme.getBlue(color);
71
72 //String s = cl.ColorToString(red, green, blue);
73
74 cpos = 0;
75 }
76
77 public void drawItem(Graphics g, int ofs, boolean sel) {
78 yTranslate = g.getTranslateY();
79 py = g.getClipHeight() - 48;
80 ph = g.getClipHeight() - 70;
81 g.setColor(0xffffff);
82 g.fillRect(0, 0, g.getClipWidth(), g.getClipHeight());
83 g.setFont(mfont);
84 String s = ColorTheme.ColorToString(red, green, blue);
85
86 g.setColor(0);
87 g.setStrokeStyle(Graphics.SOLID);
88 g.drawRect(2, 2, 48, 48);
89 g.setColor(red, green, blue);
90 g.fillRect(4, 4, 45, 45);
91 g.setColor(0x800000);
92//#ifdef COLOR_TUNE
93 FontCache.drawString(g, s + " " + ColorsList.NAMES[paramName], 70, 5, Graphics.TOP | Graphics.LEFT);
94//#endif

Callers

nothing calls this directly

Calls 1

getFontMethod · 0.95

Tested by

no test coverage detected