[Plugin] Ratiocolors

lisas4567

Member
May 25, 2018
773
0
16
On request I post this before it's entirely finished. Currently you have to edit the levels and colors in the init.js file and in the settings you can only see you levels and colors (only looks good in a webkit browser).

Please contact me if you have any problems. Just extract in your plugin folder
ratiocolor on github


iajbgaadm.jpg
 

simur612

Member
May 25, 2018
879
0
16
Currently you have to edit the levels and colors in the init.js file and in the settings you can only see you levels and colors (only looks good in a webkit browser).
1) This is a not good idea, IMHO. Use plugin's conf.php file for that - in this case each user may easy correct levels without changing your code.
2) May be, a gradient will be a better solution instead levels? E.q. you set upper border (for example 30) and calculate color by such way:

plugin.startColor = new RGBackground("#E69999");
plugin.endColor = new RGBackground("#99D699");
maxRatio = 30;
...
var percent = currentRatio/maxRatio*100;
if(percent>100)
percent = 100;
var currenColor = (new RGBackground()).setGradient(plugin.startColor,plugin.endColor,percent).getColor()
 

randac56

Member
May 25, 2018
915
0
16
I'm working on adding a real config file but I'm to lazy to complete it. Some users requested this plugin in another thread before I was finished and that's why I released it not totally finished.

The thing with gradient it how i works. It goes in a gradient between the color in the levels. So let say the color for level 0 is red and the color for level 1 is green, if you have a torrent that has ratio 0.5 i will calculate the color that is in the middle of level 0 and 1. As you can see in the screenshot I have configured my levels to be:
0 - red
1 - yellow
2 - green
30 - purple

so the torrent that has 0.5 in ratio is orange and the torrent that has 0.7 is more towards yellow and so on..
 

peshua19

Member
May 25, 2018
897
0
16
Refresh, could you change it? and yet change font color of the table, not all table

I worked it out yourself ... Because I can not count on the plugin author.
 

randac56

Member
May 25, 2018
915
0
16
Sorry about that, but long ago you were not there.

background-color doesn't work on theme Oblivion

and add
Code:
$(this).css("font-weight", "bold");Add option to on / off for font only.
 

peshua19

Member
May 25, 2018
897
0
16
Whether or not the ratio should be bold or not I think is up to the theme.

The reason why the cell-background isn't working in the Oblivion theme is because it uses an image as background, but I've made it work now. New version on GitHub
 

lisas4567

Member
May 25, 2018
773
0
16
Could you please tell me how to change the green background color into something darker?
The reason is that in oblivion theme the ratio is not easily visible (see attached color.jpg)
I want to make it like in attached color2.jpg
I tried editing
Code:
colors = [ [255, 0, 0],
[255, 255, 0],
[0, 255, 0],
[123, 17, 203]
];
to
Code:
colors = [ [255, 0, 0],
[255, 255, 0],
[17, 203, 39],
[123, 17, 203]
];
[17, 203, 39] is darker green.
But I see no difference in the color...

P.S.: Nice plugin, thanks a lot!
 

peshua19

Member
May 25, 2018
897
0
16
Could you please tell me how to change the green background color into something darker?
The reason is that in oblivion theme the ratio is not easily visible (see attached color.jpg)
I want to make it like in attached color2.jpg
I tried editing
Code:
colors = [ [255, 0, 0],
[255, 255, 0],
[0, 255, 0],
[123, 17, 203]
];
to
Code:
colors = [ [255, 0, 0],
[255, 255, 0],
[17, 203, 39],
[123, 17, 203]
];
[17, 203, 39] is darker green.
But I see no difference in the color...

P.S.: Nice plugin, thanks a lot!
Because the color goes through a gradient of colors before it reaches the level color. If you have the same levels as in the default script the next level i 3. The color of the ratiocolumn will go more towards your green as the ratio becomes closer to the level.
 

lisas4567

Member
May 25, 2018
773
0
16
I have a couple of torrents that are above 1 ratio..
In color.jpg you can see that that specified torrent has over 1.8 ratio, but the color is light green
The main problem is that you cannot actually see the ratio (Oblivion theme)
 

lisas4567

Member
May 25, 2018
773
0
16
Another question:
Currently, levels are 0,1,2,3. So colors change from level 0 (0% ratio) to 1 (100% ratio) etc
Do you think that in the future you can make it possible to define ratios like 50% (0,5), or 150% (1,5)huh.gif
I know that the color changes in stages, but I cannot find an easy way to visually see the stages from color 0 to color 1
So I may need a torrent to appear with a specific color at one stage, but I don't really know what a and b color to use in order to achieve such a thing.
Or perhaps tell me a program (or other) which will help me visualize the transition from color a to color b?
What I am trying to achieve is this:
0% -->Red
Until 50% --> shades of orange
Around 60,70% > yellow getting darker until we reach
100% -->green
From 100% and on I don't really care too much..
I hope what I say makes sense to you... embarrassed.gif
Thanks again!