Size Column - Bar Colors
-
- Posts: 131
- Joined: 28 Feb 2015 19:42
Size Column - Bar Colors
Have done some research and comprehend that the Width is hard coded to 50 pixels. But how to change those arbitrary colors to something more logical? Have in mind the visible portion of the Electromagnetic spectrum as the frequency increases; Red, Orange, Yellow, Green, Blue, Indigo and Violet.
Re: Size Column - Bar Colors
If you wanted to make the width bigger you could create a custom column, and that would enable you to set the color as you see fit. Granted it would take a bit of effort on your part, but you should be able to get something close to what it is you seem to want to achieve, if you are interested in further information then you can type the following into the XY address bar:
and here is an example:
Code: Select all
help "idh_customcolumns.htm#idh_ccdrawingbars";
Code: Select all
// draws colored bars according to the file size
$size = "<cc_size>";
switch (true){
case $size == 0: return ''; // draw nothing
case $size < 1024: return '>draw.bar ' . 100 * $size \ 1024 . ', 66CC66, BBEEBB'; //smaller 1 KB
case $size < 1048576: return '>draw.bar ' . 100 * $size \ 1048576 . ', FFBB00, FFEE88'; //smaller 1 MB
case $size < 1073741824: return '>draw.bar ' . 100 * $size \ 1073741824 . ', DD4444, FFAAAA'; //smaller 1 GB
default: return '>draw.bar ' . 100 * $size \ 1099511627776 . ', DD44AA, FFAADD'; //1 GB or more
}
-
- Posts: 131
- Joined: 28 Feb 2015 19:42
Re: Size Column - Bar Colors
Whoo - that is way different then what had been expected! Thank you for taking the time to show the path to pursue . Will work on it over the weekend. Am optimistic!
-
- Posts: 131
- Joined: 28 Feb 2015 19:42
Apology to Don
In the post mentioned it would be better to have colors "more logical". While playing with this Saturday it dawned on me the the sequence green-yellow-red comes right off a traffic light. That clearly is making more sense to the average Joe than a piece of the spectrum.
Understanding that will leave things as they are. Indeed, one does have to know "when to hold 'em and when to fold "em".
Understanding that will leave things as they are. Indeed, one does have to know "when to hold 'em and when to fold "em".
-
- Posts: 365
- Joined: 14 Sep 2013 07:22
Re: Size Column - Bar Colors
hijupe wrote: ↑20 Jan 2018 07:29 If you wanted to make the width bigger you could create a custom column, and that would enable you to set the color as you see fit. Granted it would take a bit of effort on your part, but you should be able to get something close to what it is you seem to want to achieve, if you are interested in further information then you can type the following into the XY address bar:
and here is an example taken directly from the help file:Code: Select all
help "idh_customcolumns.htm#idh_ccdrawingbars";
Code: Select all
// draws colored bars according to the file size $size = "<cc_size>"; switch (true){ case $size == 0: return ''; // draw nothing case $size < 1024: return '>draw.bar ' . 100 * $size \ 1024 . ', 66CC66, BBEEBB'; //smaller 1 KB case $size < 1048576: return '>draw.bar ' . 100 * $size \ 1048576 . ', FFBB00, FFEE88'; //smaller 1 MB case $size < 1073741824: return '>draw.bar ' . 100 * $size \ 1073741824 . ', DD4444, FFAAAA'; //smaller 1 GB default: return '>draw.bar ' . 100 * $size \ 1099511627776 . ', DD44AA, FFAADD'; //1 GB or more }
sorry my silly question , i really like xyplorer but i use simple task
to run this code should i go scripting -> run script.... -> and paste the code?
thanks
Re: Size Column - Bar Colors
No, it's a custom column script, it's only usable there...to run this code should i go scripting -> run script.... -> and paste the code?
One of my scripts helped you out? Please donate via Paypal
Re: Size Column - Bar Colors
Slight improvement, just in case somebody interested in using it:jupe wrote: ↑20 Jan 2018 07:29Code: Select all
// draws colored bars according to the file size $size = "<cc_size>"; switch (true){ case $size == 0: return ''; // draw nothing case $size < 1024: return '>draw.bar ' . 100 * $size \ 1024 . ', 66CC66, BBEEBB'; //smaller 1 KB case $size < 1048576: return '>draw.bar ' . 100 * $size \ 1048576 . ', FFBB00, FFEE88'; //smaller 1 MB case $size < 1073741824: return '>draw.bar ' . 100 * $size \ 1073741824 . ', DD4444, FFAAAA'; //smaller 1 GB default: return '>draw.bar ' . 100 * $size \ 1099511627776 . ', DD44AA, FFAADD'; //1 GB or more }
Code: Select all
// draws colored bars according to the file size
$size = "<cc_size>";
switch (true){
case $size == 0: return ''; // draw nothing
case $size < 1024: return '>draw.bar ' . 100 * $size \ 1024 + 1 . ', 66CC66'; //smaller 1 KB
case $size < 1048576: return '>draw.bar ' . 100 * $size \ 1048576 + 1 . ', FFBB00'; //smaller 1 MB
case $size < 1073741824: return '>draw.bar ' . 100 * $size \ 1073741824 + 1 . ', DD4444'; //smaller 1 GB
default: return '>draw.bar ' . 100 * $size \ 1099511627776 + 1 . ', DD44AA'; //1 GB or more
}
Minimum with of bar: 1 percent. Otherwise it could have "0 percent" which results in XY drawing the whole bar like if it was 100 percent.
Skipped secondary color: Thus, the right part of the bar is transparent.
Could look like in the pic.
- Attachments
-
- Clipboard-20211031 (2).png (8.33 KiB) Viewed 967 times
[AHK] redirecting Windows Explorer to XY, [XYS] Mini Tree with open tabs (cur loc expanded, tab folders highlighted), [AHK] customInlineRenameKeys, [AHK] clipboardHelper_and_XYEscToList