Skip to content

Commit

Permalink
epan: Describe the format of the colorfilters file
Browse files Browse the repository at this point in the history
  • Loading branch information
geraldcombs authored and AndersBroman committed Oct 14, 2024
1 parent f3e01d1 commit a29bb99
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions epan/color_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
#include <epan/prefs.h>
#include <epan/epan_dissect.h>

/*
* Each line in the colorfilters file has the following format:
*
* @<filter name>@<filter string>@[<background>][<foreground>]
* Background and foreground colors are 16-bit comma-separated RGB
* triplets. Colors are 16 bits because that's what GdkColor used.
* We might want to use a more standard, copy+paste-able color scheme
* such as #RRGGBB instead.
*/

#define RED_COMPONENT(x) (uint16_t) (((((x) >> 16) & 0xff) * 65535 / 255))
#define GREEN_COMPONENT(x) (uint16_t) (((((x) >> 8) & 0xff) * 65535 / 255))
#define BLUE_COMPONENT(x) (uint16_t) ( (((x) & 0xff) * 65535 / 255))
Expand Down

0 comments on commit a29bb99

Please sign in to comment.