Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8877389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:27:26+00:00 2026-06-14T19:27:26+00:00

I am using Jpicker for quite some time, before today my requirement was to

  • 0

I am using Jpicker for quite some time, before today my requirement was to get only 6 digit or rgb values, and store them. However, now i would like to use the Alpha/transparency value too. So now my text box should contain 8 digit not six. To enable Alpha support i did change this line in Jpicker-1.1.6,js in $.fn.jPicker.defaults

     alphaSupport:true // at line# 1748

The reason for doing this, Alpha was not showing although i did enable it from the .erb file too. My code from the .erb file look like this

     $('Alpha').jPicker({
         window:{
                expandable:true
            },
            color:{
          //to enable Alpha support
                alphaSupport:true,
                active:new $.jPicker.Color({ ahex:'#ffcc00ff' })
            },
            position:{ x:$(this).offset.left + $(this).width(), y:($(this).offset.top - $(window).scrollTop()) + $(this).height() }

        },
        function (color, context) {
            var all = color.val('all');
                alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') + ' - alpha: ' + (all && all.a + '%' || 'none'));

            if (all.a != null)
            {
              var b =   Math.precision((all.a * 100) / 255, 0);
                alert(b);
            }

            $('#Commit').css(
                    {
                        backgroundColor:all && '#' + all.hex || 'transparent'
                    }); // prevent IE from throwing exception if hex is empty
        },
         // For testing purpose
        function (color, context) {
            if (context == LiveCallbackButton.get(0)) alert('Color set from button');
            var hex = color.val('hex');
            LiveCallbackElement.css(
                    {
                        backgroundColor:hex && '#' + hex || 'transparent'
                    }); // prevent IE from throwing exception if hex is empty
        },
        function (color, context) {
            alert('"Cancel" Button Clicked');
        });

Well, in rendered Jpicker instance i can see an enabled Alpha section and small text box next to the 6 digit hex. Also in the alert i am getting a value back for all parts. However, my main concern is that how can i show the whole 8 digits and i also i want to store them as i am already storing the 6 digites.

That is my Text field generated HTML.

    <input id="app_setting_nav_background_color" class="colorInput Alpha" type="text" 
    value="000000" size="45" name="app_setting[nav_background_color]" maxlength="45" 
    style="background-color: rgb(0, 0, 0); color: rgb(255, 255, 255);">

So in short i would like to get Alpha/transparency of each element with existing RGB color, something like “#000000f”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:27:27+00:00Added an answer on June 14, 2026 at 7:27 pm

    I have solved it by myself, so In case anyone having problem with getting Alpha value from Jpicker 1.1.6. Can do the following, although it’s a nice tool but for me the settings given on Jpicker site were not working, so have to fork the plugin default functions. in my erb file, i did the following.

         $('.Alpha').jPicker({
    
    
                window:{
                    expandable:true
                },
                color:{
                    alphaSupport:true,
                    active:new $.jPicker.Color({ ahex:'#ffcc00ff' })
                },
                position:{ x:$(this).offset.left + $(this).width(), y:($(this).offset.top - $(window).scrollTop()) + $(this).height() }
    
            },
            function (color, context) {
                var all = color.val('all');
                if (all.a != null) {
                    var c = calc_in_to_hex(all.a);
                     //embedding hex of Alpha with the original string of rgb Hex
                    $(this).val($(this).val() + c);
                }
    
    
            });
    
    // function to convert int to Hex and return it back
    function calc_in_to_hex(color) {
        var result = (color | 0).toString(16);
        if (result.length == 1) result = ('0' + result);
        return result.toLowerCase();
    }
    

    Although most of it is taken from the original plugin code snippet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anyone with experience using jPicker colorpicker in a WordPress Custom Theme options panel. I
Using CI for the first time and i'm smashing my head with this seemingly
Using the Redis info command, I am able to get all the stats of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Using import datetime in python, is it possible to take a formatted time/date string
Using jQuery, how do I get the value from a textbox and then load
Using the RichTextArea in GWT, It looks like I can only change the font
I'm using jPicker ,I have 2 Questions. 1.How can I change the color to
I'm using Django and jquery, implementing jPicker http://www.digitalmagicpro.com/jPicker/ in my web application. Here I'm
Using Java,I have to fetch multiple sets of values from an XML file to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.