You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2id="changelog">Changelog <spanstyle="padding-left: 10px;"><supstyle="font-size: 50%"><ahref="#" title="Go to top of the page">Top</a></sup></span></h2>
175
180
<prestyle="height: 200px;">
176
181
177
-
2022-08-14 s-n-g
182
+
2022-08-28 s-n-g
178
183
* version 0.8.9.26 (0.9-beta23)
184
+
* adding calculated messages windows color
185
+
* adding "Calculated Color" config option
179
186
* Windows installation will try to install 7-Zip, if not
@@ -1343,6 +1350,51 @@ <h3 id="css-color-themes-restrictions">CSS color themes restrictions</h3>
1343
1350
<br/>
1344
1351
This means that, in order for a theme change to take full effect, <strong>PyRadio</strong> will have to be restarted.</p></li>
1345
1352
</ol>
1353
+
<h3id="secondary-windows-background">Secondary windows background</h3>
1354
+
<p>Secondary windows (such as messages, questions, the “<em>Theme Selection window</em>” the “<em>Encoding Selection window</em>”, etc.) originally use the same background color as the “<em>Main window</em>”.</p>
1355
+
<p>It is now possible to use a different background color for these windows, to get better visual result.</p>
1356
+
<p>There are two way to do that:</p>
1357
+
<oltype="1">
1358
+
<li><p>Defined in a theme</p></li>
1359
+
<li><p>Using a calculated color</p></li>
1360
+
</ol>
1361
+
<h4id="theme-defined-secondary-windows-color">Theme defined secondary windows color</h4>
1362
+
<p>Themes have the following entry</p>
1363
+
<pre># Message window border foreground and background.
1364
+
# The background color can be left unset.
1365
+
# Please refer to the following link for more info
<p>It is possible to define a background color as well, like so</p>
1370
+
<pre>Messages Border #a3b367 #F5DBDE</pre>
1371
+
<p>In this case, this color will be used as the Secondary Windows background color.</p>
1372
+
<p>Although one can use any color here, it is recommended to follow these guidelines for best visual result:</p>
1373
+
<oltype="1">
1374
+
<li>The color should be 1-20% lighter or darker than the “<em>Stations Background</em>” color setting of the theme.<br/>
1375
+
<br/>
1376
+
One can use <atarget="_blank" href="http://www.workwithcolor.com/hsl-color-picker-01.htm">this page</a> (or a similar one) to insert the base color and adjust the “<em>L</em>” component as needed.<br/>
1377
+
<br/>
1378
+
A terminal alternative is <atarget="_blank" href="https://github.com/sharkdp/pastel">pastel</a>, which can be used like so:</li>
1379
+
</ol>
1380
+
<pre>pastel color '#fbf1f2' # show color info
1381
+
pastel lighten .1 '#fbf1f2' # color lightened by 10%
1382
+
pastel darken .1 '#fbf1f2' # color darkened by 10%</pre>
1383
+
<olstart="2" type="1">
1384
+
<li>If the “<em>Stations Background</em>” color is dark, create a lighter version of it; if it’s light, create a darker version of it.<br/>
1385
+
<br/>
1386
+
This is just a recomenration, though; just get a color that combines well with existing ones (border foreground, stations foreground and active station).</li>
1387
+
</ol>
1388
+
<p>This information is actually relevant to creating a new <strong>PyRadio</strong> theme, but it’s very important in order to understand how the calculated background color works.</p>
1389
+
<h4id="calculated-secondary-windows-color">Calculated secondary windows color</h4>
1390
+
<p><strong>PyRadio</strong> will use the same background color for all windows by default, provided that the theme used does not define a “<em>Messages Border</em>” background color.</p>
1391
+
<p>In order to use a “<em>Messages Border</em>” background color different than the “<em>Stations background</em>” color, when “<em>Messages Border</em>” background color is not defined in the selected theme, a config option is available; “<strong>Calculated color</strong>”.</p>
1392
+
<p>This config option takes a value that’s between 0 and 0.2.</p>
1393
+
<p>If it is 0, no color change will occur.</p>
1394
+
<p>Otherwise, the value acts as a percentage (a <strong>factor</strong>), which indicates how much the luminance of the “<em>Stations background</em>” color will change to produce the new background color.</p>
1395
+
<p>This is how this works: <strong>PyRadio</strong> will calculate the “<em>Stations background</em>” color perceived brightness, which will indicate whether the color is dark or light. Then depending on that, will add or subtract <strong>factor</strong> percent from its luminance value.</p>
1396
+
<p>Finally, a check will be made to see if this color is close to “<em>Messages Border</em>” foreground color, and re-adjusted as possible.</p>
1397
+
<pstyle="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> When a calculated background color is used, pressing “<strong>~</strong>” (<strong>tilde</strong>) will toggle it on and off. This setting will be valid until <strong>PyRadio</strong> terminates, or a new theme is loaded.</p>
1346
1398
<h3id="user-themes">User themes</h3>
1347
1399
<p>Users can easiliy create their own themes, using for example <atarget="_blank" href="https://www.cssportal.com/css3-color-names/">CSS color names</a> as a resource, and</p>
@@ -832,6 +835,79 @@ These terminal will default to the old "**dark**" theme, displaying whatever col
832
835
\
833
836
This means that, in order for a theme change to take full effect, **PyRadio** will have to be restarted.
834
837
838
+
### Secondary windows background
839
+
840
+
Secondary windows (such as messages, questions, the "*Theme Selection window*" the "*Encoding Selection window*", etc.) originally use the same background color as the "*Main window*".
841
+
842
+
It is now possible to use a different background color for these windows, to get better visual result.
843
+
844
+
There are two way to do that:
845
+
846
+
1. Defined in a theme
847
+
848
+
2. Using a calculated color
849
+
850
+
#### Theme defined secondary windows color
851
+
852
+
Themes have the following entry
853
+
854
+
```
855
+
# Message window border foreground and background.
856
+
# The background color can be left unset.
857
+
# Please refer to the following link for more info
It is possible to define a background color as well, like so
864
+
865
+
866
+
```
867
+
Messages Border #a3b367 #F5DBDE
868
+
```
869
+
870
+
In this case, this color will be used as the Secondary Windows background color.
871
+
872
+
Although one can use any color here, it is recommended to follow these guidelines for best visual result:
873
+
874
+
1. The color should be 1-20% lighter or darker than the "*Stations Background*" color setting of the theme. \
875
+
\
876
+
One can use [this page](http://www.workwithcolor.com/hsl-color-picker-01.htm) (or a similar one) to insert the base color and adjust the "*L*" component as needed. \
877
+
\
878
+
A terminal alternative is [pastel](https://github.com/sharkdp/pastel), which can be used like so:
879
+
880
+
```
881
+
pastel color '#fbf1f2' # show color info
882
+
pastel lighten .1 '#fbf1f2' # color lightened by 10%
883
+
pastel darken .1 '#fbf1f2' # color darkened by 10%
884
+
```
885
+
886
+
887
+
2. If the "*Stations Background*" color is dark, create a lighter version of it; if it's light, create a darker version of it. \
888
+
\
889
+
This is just a recomenration, though; just get a color that combines well with existing ones (border foreground, stations foreground and active station).
890
+
891
+
This information is actually relevant to creating a new **PyRadio** theme, but it's very important in order to understand how the calculated background color works.
892
+
893
+
#### Calculated secondary windows color
894
+
895
+
**PyRadio** will use the same background color for all windows by default, provided that the theme used does not define a "*Messages Border*" background color.
896
+
897
+
In order to use a "*Messages Border*" background color different than the "*Stations background*" color, when "*Messages Border*" background color is not defined in the selected theme, a config option is available; "**Calculated color**".
898
+
899
+
This config option takes a value that's between 0 and 0.2.
900
+
901
+
If it is 0, no color change will occur.
902
+
903
+
Otherwise, the value acts as a percentage (a **factor**), which indicates how much the luminance of the "*Stations background*" color will change to produce the new background color.
904
+
905
+
This is how this works: **PyRadio** will calculate the "*Stations background*" color perceived brightness, which will indicate whether the color is dark or light. Then depending on that, will add or subtract **factor** percent from its luminance value.
906
+
907
+
Finally, a check will be made to see if this color is close to "*Messages Border*" foreground color, and re-adjusted as possible.
908
+
909
+
**Note:** When a calculated background color is used, pressing "**~**" (**tilde**) will toggle it on and off. This setting will be valid until **PyRadio** terminates, or a new theme is loaded.
910
+
835
911
### User themes
836
912
837
913
Users can easiliy create their own themes, using for example [CSS color names](https://www.cssportal.com/css3-color-names/) as a resource, and
Copy file name to clipboardExpand all lines: pyradio.1
+103-1
Original file line number
Diff line number
Diff line change
@@ -879,6 +879,104 @@ There are a couple of terminals (that I know of) which will permit changing thei
879
879
880
880
This means that, in order for a theme change to take full effect, \fBpyradio\fR will have to be restarted.
881
881
882
+
.RE
883
+
.PP
884
+
\fBSecondarywindowsbackground\fR
885
+
886
+
Secondary windows (such as messages, questions, the \fIThemeSelectionwindow\fR the \fIEncodingSelectionwindow\fR, etc.) originally use the same background color as the \fIMainwindow\fR.
887
+
888
+
It is now possible to use a different background color for these windows, to get better visual result.
889
+
890
+
There are two way to do that:
891
+
892
+
.RS3
893
+
.IP1.3
894
+
Defined in a theme
895
+
896
+
.IP2.3
897
+
Using a calculated color
898
+
899
+
.PP
900
+
\fBThemedefinedsecondarywindowscolor\fR
901
+
902
+
.RS3
903
+
Themes have the following entry
904
+
905
+
.RS3
906
+
\fI#Messagewindowborderforegroundandbackground.
907
+
.br
908
+
# The background color can be left unset.
909
+
.br
910
+
# Please refer to the following link for more info
It is possible to define a background color as well, like so
920
+
921
+
.RS3
922
+
\fIMessagesBorder#a3b367#F5DBDE\fR
923
+
.RE
924
+
925
+
In this case, this color will be used as the \fISecondaryWindows\fR background color.
926
+
927
+
Although one can use any color here, it is recommended to follow these guidelines for best visual result:
928
+
929
+
.RS3
930
+
.IP1.3
931
+
The color should be 1-20% lighter or darker than the "*Stations Background*" color setting of the theme.
932
+
933
+
One can use this page \fIhttp://www.workwithcolor.com/hsl-color-picker-01.htm\fR (or a similar one) to insert the base color and adjust the \fBL\fR component as needed.
934
+
935
+
A terminal alternative is \fBpastel\fR (\fIhttps://github.com/sharkdp/pastel\fR), which can be used like so:
936
+
937
+
938
+
.RS6
939
+
\fIpastelcolor'#fbf1f2'\fR # show color info
940
+
.br
941
+
\fIpastellighten.1'#fbf1f2'\fR # color lightened by 10%
942
+
.br
943
+
\fIpasteldarken.1'#fbf1f2'\fR # color darkened by 10%\fR
944
+
.RE
945
+
946
+
.IP2.3
947
+
If the \fIStationsBackground\fR color is dark, create a lighter version of it; if it's light, create a darker version of it.
948
+
949
+
This is just a recomenration, though; just get a color that combines well with existing ones (border foreground, stations foreground and active station).
950
+
951
+
This information is actually relevant to creating a new \fBpyradio\fR theme, but it's very important in order to understand how the calculated background color works.
952
+
953
+
954
+
.RE
955
+
.RE
956
+
\fBCalculatedsecondarywindowscolor\fR
957
+
.RS3
958
+
959
+
960
+
\fBpyradio\fR will use the same background color for all windows by default, provided that the theme used does not define a \fIMessagesBorder\fR background color.
961
+
962
+
In order to use a \fIMessagesBorder\fR background color different than the \fIStationsbackground\fR color, when \fIMessagesBorder\fR background color is not defined in the selected theme, a config option is available; \fBCalculatedcolor\fR".
963
+
964
+
This config option takes a value that's between 0 and 0.2.
965
+
966
+
If it is 0, no color change will occur.
967
+
968
+
Otherwise, the value acts as a percentage (a \fBfactor\fR), which indicates how much the luminance of the \fIStationsbackground\fR color will change to produce the new background color.
969
+
970
+
This is how this works: \fBpyradio\fR will calculate the \fIStationsbackground\fR color perceived brightness, which will indicate whether the color is dark or light. Then depending on that, will add or subtract \fBfactor\fR percent from its luminance value.
971
+
972
+
Finally, a check will be made to see if this color is close to \fIMessagesBorder\fR foreground color, and re-adjusted as possible.
973
+
974
+
975
+
.IP\fBNote\fR
976
+
When a calculated background color is used, pressing \fI~\fR (\fItilde\fR) will toggle it on and off. This setting will be valid until \fBPyRadio\fR terminates, or a new theme is loaded.
977
+
978
+
.RE
979
+
882
980
.RE
883
981
.PP
884
982
\fBUserthemes\fR
@@ -891,11 +989,15 @@ Copy (and rename) one of the \fISystem Themes\fR to the user's \fBthemes\fR fold
891
989
892
990
To gain access to the \fISystemThemes\fR, execute the following commands
Copy file name to clipboardExpand all lines: pyradio/config_window.py
+3-1
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ class PyRadioConfigWindow(object):
79
79
'|', 'Default value = dark'])
80
80
_help_text.append(['If False, theme colors will be used.', '|',
81
81
"If True and a compositor is running, the stations' window background will be transparent.", '|', "If True and a compositor is not running, the terminal's background color will be used.", '|', 'Default value: False'])
82
-
_help_text.append(['Pyradio can calculate and use an alternative color for secondary windows.', '|', 'This option will determine if this color will be used (value > 0) or not (value = 0), provided that the theme used does not already provide it.', '|', 'The value of this option is actually the factor to darken or lighten the main (stations) background color.', '|', 'You can get more info on this at https://github.com/coderholic/pyradio#calculated-colors', '|', 'Valid Values: 0-0.2', 'Default value: 0'])
82
+
_help_text.append(['Pyradio can calculate and use an alternative color for secondary windows.', '|', 'This option will determine if this color will be used (value > 0) or not (value = 0), provided that the theme used does not already provide it.', '|', 'The value of this option is actually the factor to darken or lighten the main (stations) background color.', '|', 'You can get more info on this at https://github.com/coderholic/pyradio#secondary-windows-background', '|', 'Valid Values: 0-0.2', 'Default value: 0'])
83
83
_help_text.append(None)
84
84
_help_text.append(['Specify whether you will be asked to confirm every station deletion action.',
0 commit comments