Git Product home page Git Product logo

Comments (4)

PennRobotics avatar PennRobotics commented on July 21, 2024

Neutral, positive, and negative voltage colors are changeable in the web interface via the menu: Options → Other Options

If you need to change it in the Java source: setColorScale()

from circuitjs1.

WenterQ avatar WenterQ commented on July 21, 2024

The effect achieved is that some wires are yellow, some wires are blue, and so on

from circuitjs1.

PennRobotics avatar PennRobotics commented on July 21, 2024

... like wire-specific voltage colors? e.g. one wire at 5 volts is red while another at 5 volts is blue? That's an interesting use case.

It could be maybe confusing when two elements with different colors intersect---particularly components. If a resistor is 5 v blue at one end and 5 v red at the other, should the color blend? Should the max and min voltage for choosing color also be per-wire variable?

That would generally be cool for a circuit like "op-amp internals" or "555 internals" or some CPU register circuits, where you can split each subcircuit—level shifters, comparators, mirror, output stage—into its own color.

I don't know how the JavaScript elements are drawn, but the easiest way (for me) to implement this (if everything is an SVG) is by figuring out the id/data-name/class for each drawn component and override whatever property is being used for gradients AFTER everything is already drawn on the JavaScript-enabled page. I'm on my phone right now and haven't ever looked thru the new (non-java) source, so i don't know if anything in this paragraph would work. If I remember and have time, I'll try to do this soon

from circuitjs1.

pfalstad avatar pfalstad commented on July 21, 2024

"If there is no current passing, it is gray." I suppose you mean that the amount of current is under some threshold value?

Changing the color for individual wires is not that bad, but every component has small pieces of wire embedded in it, so they would all have to change. Nothing is an SVG, unfortunately, all the drawing is done in code. I suppose you could store the wire color on a per-node basis and each element could get the color from the node.

from circuitjs1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.