Custom Color Schemes - ubergeek42/weechat-android GitHub Wiki
Weechat-Android supports custom color schemes that modify WeeChat colors as well as some UI colors. Please take a look at the bundled color schemes for an example.
Note: color scheme file format changed slightly in version 0.14.
Color scheme loading
Color schemes are defined using text file. The file must end in
theme.properties and placed in a folder named weechat in your External
Storage, usually /storage/emulated/0/weechat. You can check the exact location
in Settings β Theme. Once the file is there, it should be available in the
list of color schemes.
File format
Each file must conform to the java properties file format, which mostly means
that lines are key = value pairs, blank lines are ignored, and comments are on
their own line and start with a #. Values are numbers between 0x000000 and 0xffffff in
any format parsable by java. Most of the data is optional. The app understands
the following keys:
-
Name and main colors
nameβ name of the schemedefaultβ color of the text if it's not otherwise colored (default:color7)default_bgβ background color of the chat area (default:color0)primaryβ primary UI color. used to color toolbars, menus, etcprimary_darkβ if the Android version allows it, used to color status bar and navigation bar. The app will try to set the color of the foreground items (Back/Home buttons, Wifi indicator, etc) automatically, but earlier Android versions don't allow it. In this case, only dark colors can be used.
-
WeeChat option colors
WeeChat sends the app colors in two ways. One is an explicit terminal color code, and another is an option name. In the latter case, it's up to Weechat-Android to decide which color to use. You can specify colors for the following options, as well as background colors, where applicable (e.g.
chat_highlight_bg):separatorβ not used (12/)chatβ welp.. (default/default_bg)chat_timeβ used to color the time stamp (default/)chat_time_delimitersβ not used (3/)chat_prefix_error(11/)chat_prefix_network(13/)chat_prefix_actionβ the*in* user slaps everyone(15/)chat_prefix_joinβ-->(2/)chat_prefix_quitβ<--(1/)chat_prefix_moreβ the+that appears after truncated nickname (5/)chat_prefix_suffix(10/)chat_buffer(15/)chat_server(3/)chat_channel(15/)chat_nick(6/)chat_nick_selfβ our own nick (15/)chat_nick_otherβ nick of the person you are talking to in private (14/)chat_hostβ color ofuser@host(14/)chat_delimitersβ()s and[]s around (some) nicks and hosts (10/)chat_highlightβ highlights! works nicely with colorize_lines.pl (11/13)chat_read_markerβ read marker line. background value is not used (13/)chat_text_found(11/5)chat_value(14/)chat_prefix_buffer(3/)chat_tags(9/)chat_inactive_window(8/)chat_inactive_bufferβ this colors βnon-human linesβ if the according option is set. background is ignored (8/)chat_prefix_buffer_inactive_buffer(8/)chat_nick_offline(8/)chat_nick_offline_highlight(default/8)chat_nick_prefixβ the<before the nick (10/)chat_nick_suffixβ the>after the nick (10/)emphasis(11/13) (for some reason this isemphasizedin/iset)chat_day_change(14/)
In paretheses given are the default terminal colors that are used when the color scheme doesn't set the color for the option.
-
Terminal color redefinitions
Terminal colors, whether received directly from WeeChat, or when using the default option colors, can be redefined using keys from
color0,color0_bgtocolor255,color255_bg.
This is especially useful when adjusting colors for the light background.
If you want to modify a lot of colors at once, it might be useful to use the included color scheme generator that builds color schemes from an image that has all the palette colors. You will have to edit
palettes.xcf(a native Gimp format), extract the layers into individual files, and then compile the color schemes withextract_from_pngs.py(requires Python3 and Pillow). Test your colors using commands generated withgenerate_test.py.