Given a background color, how to get a foreground color that makes it readable on that background color?

Here’s one I did in both Java and Javascript. It’s loosely based off this one in javascript. I took the Luminance formula from here. The sweet-spot of the threshold from my eye was about 140. Java version: public class Color { private float CalculateLuminance(ArrayList<Integer> rgb){ return (float) (0.2126*rgb.get(0) + 0.7152*rgb.get(1) + 0.0722*rgb.get(2)); } private ArrayList<Integer> … Read more

Are there any High Level, easy to install GUI libraries for Common Lisp? [closed]

Ltk is quite popular, very portable, and reasonably well documented through the Tk docs. Installation on SBCL is as easy as saying: (require :asdf-install) (asdf-install:install :ltk) There’s also Cells-Gtk, which is reported to be quite usable but may have a slightly steeper learning curve because of its reliance on Cells. EDIT: Note that ASDF-INSTALL is … Read more

Good examples of GUI design for business-oriented, heavy data-entry (CRUD) applications [closed]

I don’t have any examples to point to. In truth, many of these screens may be hard to find on the web for the simple fact that most of them tend to be “ugly”. These kinds of screens are rarely pretty. I can offer some tips, from long history working with these things. Consistency. Make … Read more

How do I make a simple solid border around a FlowPane in javafx

There’s a setBorder() method, so you can add a border to your pane: FlowPane pane = new FlowPane(10, 10); pane.setBorder(new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT))); Though this is really more simple with inline CSS: pane.setStyle(“-fx-border-color: black”); Or you could apply it with a CSS file: FlowPane pane = new FlowPane(10, 10); pane.getStyleClass().add(“pane”); Scene scene = … Read more

How to maintain widgets aspect ratio in Qt?

You don’t have to implement your own layout manager. You can do with inheriting QWidget and reimplementing int QWidget::heightForWidth( int w ) { return w; } to stay square. However, heightForWidth() doesn’t work on toplevel windows on X11, since apparently the X11 protocol doesn’t support that. As for centering, you can pass Qt::AlignCenter as the … Read more

Is it wrong to use the hand cursor for clickable items such as buttons? [closed]

The reason why the cursor changes shape when over a hyperlink probably has to do with the following: hyperlinks started in blocks of text and as such it wasn’t obvious that you could click on them to open another page. the change in display style for links in and of itself probably wasn’t enough to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)