Skip to content
This repository was archived by the owner on Nov 7, 2020. It is now read-only.

smallstoneapps/pebble-moon-layer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pebble Moon Layer

A Layer for Pebble apps that renders a small (Phases 10x10) icon representing the moon phase for a given date and hemisphere.

Usage

  1. Install the library by running pebble package install pebble-moon-layer --save.

  2. Include moon-layer.h in your code.

    #include <pebble-moon-layer/moon-layer.h>
  3. Create a new MoonLayer. The GPoint parameter represents the position of the center-point of the image.

    MoonLayer* moon_layer = moon_layer_create(GPoint(20, 20));
  4. Set the date for the layer.

    time_t temp = time(NULL);
    struct tm *tick_time = localtime(&temp);
    moon_layer_set_date(moon_layer, tick_time);

Other configurations

People in different hemispheres see the moon in a slightly different way, so it's possible to configure the hemisphere where the moon is being viewed from. Possible options are MoonLayerHemisphereNorthern and MoonLayerHemisphereSouthern (default value is MoonLayerHemisphereNorthern).

moon_layer_set_hemisphere(moon_layer, MoonLayerHemisphereSouthern);

It's also possible to display a 1px border around the icon to improve visibility. Any GColor value is accepted. Use GColorClear for no border (default values are GColorWhite on BW devices and GColorClear on Color devices).

moon_layer_set_border_color(moon_layer, GColorBlack);

Phases

About

A Layer for Pebble apps that renders a small icon representing the moon phase.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 77.7%
  • Python 22.3%