Skip to content

Commit

Permalink
Minor improvements to theme docs
Browse files Browse the repository at this point in the history
At some point the theme file went to JSON but the territory examples were still in python. Also, `theme-<whatever>.json` is better.
  • Loading branch information
milescrawford authored Sep 26, 2024
1 parent 2bc8d1a commit 66f194a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions THEMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Version 1.7 brings basic support for themes, and 1.9 extends it to include keybo
## Creating and editing themes

* Look at the `Theme` class in [`katrain/gui/theme.py`](https://github.com/sanderland/katrain/blob/master/katrain/gui/theme.py).
* Make a `theme<yourthemename>.json` file in your `<home dir>/.katrain` directory and specify any variables from the above class you want to override, e.g.
* Make a `theme-<yourthemename>.json` file in your `<home dir>/.katrain` directory and specify any variables from the above class you want to override, e.g.
```json
{
"BACKGROUND_COLOR": [1,0,0,1],
Expand Down Expand Up @@ -40,13 +40,15 @@ Version 1.7 brings basic support for themes, and 1.9 extends it to include keybo

The stone marks, transparency, and territory style are independent; the table above presents a collection of possible variants.
The relevant variables are:
```
TERRITORY_DISPLAY = "blended" | "shaded" | "marks" | "blocks"
STONE_MARKS = "all" | "weak" | "none"
OWNERSHIP_COLORS = {"B": [0.0, 0.0, 0.10, 0.75], "W": [0.92, 0.92, 1.0, 0.800]}
BLOCKS_THRESHOLD = 0.6
MARK_SIZE = 0.42 # as fraction of stone size
STONE_MIN_ALPHA = 0.5
```json
{
"TERRITORY_DISPLAY" : "blended" | "shaded" | "marks" | "blocks",
"STONE_MARKS" : "all" | "weak" | "none",
"OWNERSHIP_COLORS" : {"B": [0.0, 0.0, 0.10, 0.75], "W": [0.92, 0.92, 1.0, 0.800]},
"BLOCKS_THRESHOLD" : 0.6,
"MARK_SIZE" : 0.42, # as fraction of stone size
"STONE_MIN_ALPHA" : 0.5
}
```

The colors are specified as RGB values and a maximum alpha transparency.
Expand Down

0 comments on commit 66f194a

Please sign in to comment.