mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-12-17 23:04:24 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7234eb13c | ||
|
|
2563daae93 | ||
|
|
722382643a | ||
|
|
6cfcec690e | ||
|
|
006a6cb9e0 | ||
|
|
1cfa744fee | ||
|
|
cfb4cec041 |
@@ -50,8 +50,10 @@ The first time the program is running, you will be presented with the guide sect
|
||||
|
||||
To use Nomad Network on packet radio or LoRa, you will need to configure your Reticulum installation to use any relevant packet radio TNCs or LoRa devices on your system. See the [Reticulum documentation](https://markqvist.github.io/Reticulum/manual/interfaces.html) for info.
|
||||
|
||||
**Please Note**: If this is the very first time you use pip to install a program on your system, you might need to reboot your system for the program to become available. If you get a "command not found" error or similar when running the program, reboot your system and try again.
|
||||
|
||||
### Installing on Android
|
||||
You can install Nomad Network on Android using Termux, but there's a few extra commands involved than the above one-liner. The process is documented in the [Android Installation](https://markqvist.github.io/Reticulum/manual/gettingstartedfast.html#reticulum-on-android) section of the Reticulum Manual. Once the Reticulum has been installed according to the linked documentation, Nomad Network can be installed as usual with pip.
|
||||
You can install Nomad Network on Android using Termux, but there's a few more commands involved than the above one-liner. The process is documented in the [Android Installation](https://markqvist.github.io/Reticulum/manual/gettingstartedfast.html#reticulum-on-android) section of the Reticulum Manual. Once the Reticulum has been installed according to the linked documentation, Nomad Network can be installed as usual with pip.
|
||||
|
||||
## Support Nomad Network
|
||||
You can help support the continued development of open, free and private communications systems by donating via one of the following channels:
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.1.5"
|
||||
__version__ = "0.1.6"
|
||||
@@ -22,9 +22,9 @@ THEMES = {
|
||||
# Style name # 16-color style # Monochrome style # 88, 256 and true-color style
|
||||
("heading", "light gray,underline", "default", "underline", "g93,underline", "default"),
|
||||
("menubar", "black", "light gray", "standout", "#111", "#bbb"),
|
||||
("scrollbar", "light gray", "default", "standout", "#444", "default"),
|
||||
("scrollbar", "light gray", "default", "default", "#444", "default"),
|
||||
("shortcutbar", "black", "light gray", "standout", "#111", "#bbb"),
|
||||
("body_text", "white", "default", "default", "#ddd", "default"),
|
||||
("body_text", "light gray", "default", "default", "#ddd", "default"),
|
||||
("error_text", "dark red", "default", "default", "dark red", "default"),
|
||||
("warning_text", "yellow", "default", "default", "#ba4", "default"),
|
||||
("inactive_text", "dark gray", "default", "default", "dark gray", "default"),
|
||||
@@ -45,7 +45,7 @@ THEMES = {
|
||||
("list_normal", "dark gray", "default", "default", "#bbb", "default"),
|
||||
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
||||
("list_focus_untrusted", "black", "light gray", "standout", "#810", "#aaa"),
|
||||
("topic_list_normal", "white", "default", "default", "#ddd", "default"),
|
||||
("topic_list_normal", "light gray", "default", "default", "#ddd", "default"),
|
||||
("browser_controls", "light gray", "default", "default", "#bbb", "default"),
|
||||
("progress_full", "black", "light gray", "standout", "#111", "#bbb"),
|
||||
("progress_empty", "light gray", "default", "default", "#ddd", "default"),
|
||||
@@ -56,9 +56,9 @@ THEMES = {
|
||||
# Style name # 16-color style # Monochrome style # 88, 256 and true-color style
|
||||
("heading", "dark gray,underline", "default", "underline", "g93,underline", "default"),
|
||||
("menubar", "black", "dark gray", "standout", "#111", "#bbb"),
|
||||
("scrollbar", "dark gray", "default", "standout", "#444", "default"),
|
||||
("scrollbar", "dark gray", "default", "default", "#444", "default"),
|
||||
("shortcutbar", "black", "dark gray", "standout", "#111", "#bbb"),
|
||||
("body_text", "black", "default", "default", "#222", "default"),
|
||||
("body_text", "dark gray", "default", "default", "#222", "default"),
|
||||
("error_text", "dark red", "default", "default", "dark red", "default"),
|
||||
("warning_text", "yellow", "default", "default", "#ba4", "default"),
|
||||
("inactive_text", "light gray", "default", "default", "dark gray", "default"),
|
||||
@@ -78,7 +78,7 @@ THEMES = {
|
||||
("list_normal", "dark gray", "default", "default", "#444", "default"),
|
||||
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
||||
("list_focus_untrusted", "black", "dark gray", "standout", "#810", "#aaa"),
|
||||
("topic_list_normal", "black", "default", "default", "#222", "default"),
|
||||
("topic_list_normal", "dark gray", "default", "default", "#222", "default"),
|
||||
("browser_controls", "dark gray", "default", "default", "#444", "default"),
|
||||
("progress_full", "black", "dark gray", "standout", "#111", "#bbb"),
|
||||
("progress_empty", "dark gray", "default", "default", "#ddd", "default"),
|
||||
|
||||
@@ -397,6 +397,9 @@ The following line should contain a green gradient bar:
|
||||
The following line should contain a blue gradient bar:
|
||||
`B001 `B002 `B003 `B004 `B005 `B006 `B007 `B008 `B009 `B00a `B00b `B00c `B00d `B00e `B00f`b
|
||||
|
||||
The following line should contain a grayscale gradient bar:
|
||||
`Bg06 `Bg13 `Bg20 `Bg26 `Bg33 `Bg40 `Bg46 `Bg53 `Bg59 `Bg66 `Bg73 `Bg79 `Bg86 `Bg92 `Bg99`b
|
||||
|
||||
Unicode Glyphs : \u2713 \u2715 \u26a0 \u24c3 \u2193
|
||||
|
||||
Nerd Font Glyphs : \uf484 \uf9c4 \uf719 \uf502 \uf415 \uf023 \uf06e
|
||||
|
||||
@@ -185,14 +185,155 @@ def style_to_state(style, state):
|
||||
def make_style(state):
|
||||
def mono_color(fg, bg):
|
||||
return "default"
|
||||
|
||||
def low_color(color):
|
||||
# TODO: Implement low-color mapper
|
||||
return "default"
|
||||
try:
|
||||
result = "default"
|
||||
if color == "default":
|
||||
result = "default"
|
||||
|
||||
elif len(color) == 6:
|
||||
r = str(color[0])
|
||||
g = str(color[2])
|
||||
b = str(color[4])
|
||||
color = r+g+b
|
||||
|
||||
if len(color) == 3:
|
||||
t = 7
|
||||
|
||||
if color[0] == "g":
|
||||
val = int(color[1:2])
|
||||
if val < 25:
|
||||
result = "black"
|
||||
elif val < 50:
|
||||
result = "dark gray"
|
||||
elif val < 75:
|
||||
result = "light gray"
|
||||
else:
|
||||
result = "white"
|
||||
else:
|
||||
r = int(color[0], 16)
|
||||
g = int(color[1], 16)
|
||||
b = int(color[2], 16)
|
||||
|
||||
if r == g == b:
|
||||
val = int(color[0], 16)*6
|
||||
if val < 12:
|
||||
result = "black"
|
||||
elif val < 50:
|
||||
result = "dark gray"
|
||||
elif val < 80:
|
||||
result = "light gray"
|
||||
else:
|
||||
result = "white"
|
||||
|
||||
else:
|
||||
if r == b:
|
||||
if r > g:
|
||||
if r > t:
|
||||
result = "light magenta"
|
||||
else:
|
||||
result = "dark magenta"
|
||||
else:
|
||||
if g > t:
|
||||
result = "light green"
|
||||
else:
|
||||
result = "dark green"
|
||||
if b == g:
|
||||
if b > r:
|
||||
if b > t:
|
||||
result = "light cyan"
|
||||
else:
|
||||
result = "dark cyan"
|
||||
else:
|
||||
if r > t:
|
||||
result = "light red"
|
||||
else:
|
||||
result = "dark red"
|
||||
if g == r:
|
||||
if g > b:
|
||||
if g > t:
|
||||
result = "yellow"
|
||||
else:
|
||||
result = "brown"
|
||||
else:
|
||||
if b > t:
|
||||
result = "light blue"
|
||||
else:
|
||||
result = "dark blue"
|
||||
|
||||
if r > g and r > b:
|
||||
if r > t:
|
||||
result = "light red"
|
||||
else:
|
||||
result = "dark red"
|
||||
if g > r and g > b:
|
||||
if g > t:
|
||||
result = "light green"
|
||||
else:
|
||||
result = "dark green"
|
||||
if b > g and b > r:
|
||||
if b > t:
|
||||
result = "light blue"
|
||||
else:
|
||||
result = "dark blue"
|
||||
|
||||
except Exception as e:
|
||||
result = "default"
|
||||
|
||||
return result
|
||||
|
||||
def high_color(color):
|
||||
def parseval_hex(char):
|
||||
return hex(max(0,min(int(char, 16),16)))[2:]
|
||||
|
||||
def parseval_dec(char):
|
||||
return str(max(0,min(int(char), 9)))
|
||||
|
||||
if color == "default":
|
||||
return color
|
||||
return "default"
|
||||
else:
|
||||
return "#"+color
|
||||
if len(color) == 6:
|
||||
try:
|
||||
v1 = parseval_hex(color[0])
|
||||
v2 = parseval_hex(color[1])
|
||||
v3 = parseval_hex(color[2])
|
||||
v4 = parseval_hex(color[3])
|
||||
v5 = parseval_hex(color[4])
|
||||
v6 = parseval_hex(color[5])
|
||||
color = "#"+v1+v2+v3+v4+v5+v6
|
||||
|
||||
except Exception as e:
|
||||
return "default"
|
||||
|
||||
return color
|
||||
|
||||
elif len(color) == 3:
|
||||
if color[0] == "g":
|
||||
try:
|
||||
v1 = parseval_dec(color[1])
|
||||
v2 = parseval_dec(color[2])
|
||||
|
||||
except Exception as e:
|
||||
return "default"
|
||||
|
||||
return "g"+v1+v2
|
||||
|
||||
else:
|
||||
try:
|
||||
v1 = parseval_hex(color[0])
|
||||
v2 = parseval_hex(color[1])
|
||||
v3 = parseval_hex(color[2])
|
||||
color = v1+v2+v3
|
||||
|
||||
except Exception as e:
|
||||
return "default"
|
||||
|
||||
r = color[0]
|
||||
g = color[1]
|
||||
b = color[2]
|
||||
return "#"+r+r+g+g+b+b
|
||||
|
||||
|
||||
bold = state["formatting"]["bold"]
|
||||
underline = state["formatting"]["underline"]
|
||||
|
||||
Reference in New Issue
Block a user