AnantLabs / jpicker

Automatically exported from code.google.com/p/jpicker
0 stars 0 forks source link

Re-enable support for alpha switch #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In V1.0.11b and older there was alphaSupport switch and checkbox in color 
picker.

If it is possible, please add switch to jPicker, which enable/disable alpha 
support. I think that checkbox or button, which switch this as user want 
with possiblity to set default value from script will be great.

I'm using jPicker in addin for web developers and in most cases, they don't 
need alpha channel and last 'ff' value is confusing.

Thanks for consider this suggestion.

Original issue reported on code.google.com by kep...@gmail.com on 31 Jan 2010 at 7:33

GoogleCodeExporter commented 9 years ago
I will re-implement this change then for the next version. However, I am going 
to make 
it a hard setting with the initialization or change it by code, but no public 
user 
interface to enable/disable this feature. I will also remove the last 'ff' when 
alpha 
is disabled.

I would like to hear opinions on what default setting should be as well.

Original comment by christop...@gmail.com on 1 Feb 2010 at 4:57

GoogleCodeExporter commented 9 years ago

Original comment by christop...@gmail.com on 1 Feb 2010 at 4:59

GoogleCodeExporter commented 9 years ago
Thanks!

From my point of view it depends only on where is jPicker used most. For css 
coders, 
alpha is rarely used but there are many other areas where alpha is important.

As long, as there will be some option while initilalizing jPicker, both options 
are 
equal imho

Original comment by kep...@gmail.com on 1 Feb 2010 at 6:43

GoogleCodeExporter commented 9 years ago
I just started using the jPicker 1.0.13 on a website I am building.  I would 
prefer the 
option  to disable alphasupport also as well as remove the trailing ff and just 
show 
the 6 hex digits to represent the color.
Thanks.

Original comment by algorge...@gmail.com on 11 Feb 2010 at 9:10

GoogleCodeExporter commented 9 years ago
We are using jPicker but doing our best to hide the extra f's right now... Our 
users just 
don't get what the last two letters are for and are very accustomed to seeing 
it with 6.  
In the API it seems to return the transparency info separately up until it gets 
displayed 
or returned... if you ask me I would keep it separate in the UI as well.  
People get 
transparency when it's not lumped together with color, but most people don't 
recognize 
this representation of it automatically.

Original comment by smwe...@gmail.com on 30 Mar 2010 at 4:46

GoogleCodeExporter commented 9 years ago
If I could disable the alpha and remove if from the hex (returning a normal 6 
digit
hex), this would be the PERFECT tool for what I'm working on. Does anyone know 
of a
code change I could make to accomplish this? Or any work around? I am 
considering
using the older version where this was an option.
Thanks

Original comment by LordA...@gmail.com on 12 Apr 2010 at 6:21

GoogleCodeExporter commented 9 years ago
Well I answered my own question. Looks like I successfully removed the final 2 
hex
values with a simple code change. I'll post what I did here in case it will be 
useful
to anyone else.

In the file jpicker-1.0.13.js I changed line 531 from this:
return r != null && g != null && b != null && a != null ? 
ColorMethods.rgbaToHex({ r:
r, g: g, b: b, a: a }) : null;

To this:
return r != null && g != null && b != null && a != null ? 
ColorMethods.rgbaToHex({ r:
r, g: g, b: b, a: a }).substring(0, 6) : null;

I just added a substring. You can find this line in the full source as well as 
the
minified version by searching for "get_Rgba:"

Cheers

Original comment by LordA...@gmail.com on 12 Apr 2010 at 7:08

GoogleCodeExporter commented 9 years ago
The next version for my plugin, which re-includes this feature, and a whole 
bunch of 
other changes and enhancements on the internal processing is in testing now and 
likely 
will be uploaded today. There will be some changes you will need to make to 
implement 
the changes, but they are all pretty minor. I will post to this thread again 
once the 
new version is uploaded.

Original comment by christop...@gmail.com on 12 Apr 2010 at 3:56

GoogleCodeExporter commented 9 years ago
jPicker V1.1.0 has now been submitted to the repository and a new ZIP file 
uploaded 
to Google Code. You can also view the full documentation (and download it from) 
http://www.digitalmagicpro.com/jPicker/.

This new version re-implements the alphaSupport switch and 6-character hex 
codes. It 
also includes a completely reworked event model, alteration of the color from 
script, 
with full visual updates, and slightly better IE quirks mode support.

You will need to read the documentation to make some small changes due to a new 
method for getting/setting color information from the Color object. The get_* 
methods 
are now gone in favor of a single "val" function for getting AND setting.

Original comment by christop...@gmail.com on 12 Apr 2010 at 6:41