<commit_before># GBitmap-Colour-Palette-Manipulator

This library was created in order to manipulate the colour palettes of gbitmaps. It will be useful if you are trying to adapt your black and white pebble app and app icons for Pebble Time (colours). Instead of including resources for each colour of an icon, you can just change it's colour palette with this library.

The library includes a sample project which loads a picture and spits out its colour palette. You can then decide which colours to replace. 

The following library calls are available:
```c
char* get_gbitmapformat_text(GBitmapFormat format);
```
This function will return the GBitmapFormat for the given GBitmapFormat.

```c
char* get_gcolor_text(GColor m_color);
```
This function will return the text of the given GColor (ex: "GColorDukeBlue")

```c
void spit_gbitmap_colour_palette(GBitmap *im);
```
This function will spit out the number of colours in a gbitmap and will list which colours it contains. This is one of the most important functions in this library since you'll want to pass your gbitmap to it the first time in order to determine which colours it contains; which you'll use in the next function.

```c
void replace_gbitmap_colour(GColor colour_to_replace, GColor replace_with_colour, GBitmap *im, BitmapLayer *bml);
```
This is function allows you to pass in a gbitmap, the colour you want to replace and the target colour. You also pass your BitmapLayer to this function so that it can automatically be marked dirty. This is an all in one function; it replaces the specified colour and automatically updates the BitmapLayer.

Enjoy and feel free to provide feedback or ideas.

Jonathan.<commit_msg>Consistency change and new function<commit_after># GBitmap-Colour-Palette-Manipulator

This library was created in order to manipulate the color palettes of gbitmaps. It will be useful if you are trying to adapt your black and white pebble app and app icons for Pebble Time (colors). Instead of including resources for each color of an icon, you can just change it's color palette with this library.

The library includes a sample project which loads a picture and spits out its color palette. You can then decide which colors to replace. 

The following library calls are available:
```c
char* get_gbitmapformat_text(GBitmapFormat format);
```
This function will return the GBitmapFormat for the given GBitmapFormat.

```c
char* get_gcolor_text(GColor m_color);
```
This function will return the text of the given GColor (ex: "GColorDukeBlue")

```c
bool gbitmap_color_palette_contains_color(GColor m_color, GBitmap *im);
```
This function will return true if the provided gbitmap contains the specified color. False otherwise. 

```c
void spit_gbitmap_color_palette(GBitmap *im);
```
This function will spit out the number of colors in a gbitmap and will list which colors it contains. This is one of the most important functions in this library since you'll want to pass your gbitmap to it the first time in order to determine which colors it contains; which you'll use in the next function.

```c
void replace_gbitmap_color(GColor color_to_replace, GColor replace_with_color, GBitmap *im, BitmapLayer *bml);
```
This is function allows you to pass in a gbitmap, the color you want to replace and the target color. You also pass your BitmapLayer to this function so that it can automatically be marked dirty. This is an all in one function; it replaces the specified color and automatically updates the BitmapLayer.

Enjoy and feel free to provide feedback or ideas.

Jonathan.
{'fraction_non_alphanumeric': 0.04791258055477725, 'fraction_numerical': 0.0, 'mean_word_length': 5.040609137055838, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1104571', 'n_tokens_mistral': 955, 'n_tokens_neox': 912, 'n_words': 528}