suncalc icon indicating copy to clipboard operation
suncalc copied to clipboard

Add support for the blue hour e.g., blueHour and blueHourEnd

Open ghost opened this issue 8 years ago • 3 comments

Morning magic hours Blue hour (from -6° to -4°) Golden hour (from -4° to 6°)

Evening magic hours Golden hour (from 6° to -4°) Blue hour (from -4° to -6°)

Reference: http://www.photopills.com/articles/understanding-golden-hour-blue-hour-and-twilights

ghost avatar Jan 03 '17 14:01 ghost

Good suggestion, thanks!

mourner avatar Jan 03 '17 14:01 mourner

Did u calculated the blue hour in your lib ? :)

Bramichou avatar Oct 20 '17 11:10 Bramichou

In my variation (and I believe it’s correct), the blue hour is between -4° and -8°, see https://en.wikipedia.org/wiki/Blue_hour.

Here’s how I used it:

var times = SunCalc.times = [
    [     6, 'goldenHourEnd',   'goldenHour'      ],
    [  -0.3, 'sunriseEnd',      'sunsetStart'     ],
    [-0.833, 'sunrise',         'sunset'          ],
    [    -4, 'blueHourDawnEnd', 'blueHourDusk'    ],
    [    -6, 'dawn',            'dusk'            ],
    [    -8, 'blueHourDawn',    'blueHourDuskEnd' ],
    [   -12, 'nauticalDawn',    'nauticalDusk'    ],
    [   -18, 'nightEnd',        'night'           ]
];

Unfortunately, it makes some calculations a little more difficult because the blue hour stretches within the civil and nautical twilight phases.

Moonbase59 avatar Jun 05 '18 13:06 Moonbase59