Skip to content

Commit

Permalink
make off segments light gray in white background mode (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalstad committed Oct 27, 2024
1 parent ab8b23f commit 28669ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/com/lushprojects/circuitjs1/client/SevenSegElm.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ void setDefaults() {
String dump() { return super.dump() + " " + baseSegmentCount + " " + extraSegment + " " + diodeDirection; }

String getChipName() { return segmentCount + "-segment display"; }
Color darkred;
Color darkred, lightgray;

void setupPins() {
if (pinCount == 0)
return;
darkred = new Color(30, 0, 0);
lightgray = new Color(255-10, 255-10, 255-10);
int segmentPinsOnLeftSide = (baseSegmentCount+1)/2;
sizeY = segmentPinsOnLeftSide;
if (baseSegmentCount == 7) {
Expand Down Expand Up @@ -279,7 +280,7 @@ void stepFinished() {
void setColor(Graphics g, int p) {
if (diodeDirection == 0) {
g.setColor(pins[p].value ? Color.red :
sim.printableCheckItem.getState() ? Color.white : darkred);
sim.printableCheckItem.getState() ? lightgray : darkred);
return;
}
// 10mA current = max brightness
Expand Down

0 comments on commit 28669ed

Please sign in to comment.