Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Golden ratio in GUI design
6 points by paulreiners on Dec 17, 2009 | hide | past | favorite | 2 comments
Does anyone else try to use the golden ratio in their GUI components? I've been doing this for awhile now and it does make them look better, I think.

    final double goldenRatio = 1.61803399;
    dialog.setSize(
        DIALOG_WIDTH,
        (int) Math.round(DIALOG_WIDTH / goldenRatio));



I am not sure I understand - wouldn't you want to be working with the DIALOG_HEIGHT in relation to the DIALOG_WIDTH?


He is. The first argument is the width, the second is the height. Therefore, the height is calculated based on the golden ratio applied to the width.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: