Getting RGB only components of color through QML

For example, we have the property QML or JS variable with type Color:

color variant property: Color.Red

How can I get the intensity values of R, G and B of it via the QML code only? Is this possible?

Hello! It is not possible. These methods are not exported to QML. But this can be bypassed easily by creating a C++ helper function. Please see this thread for more details:
http://supportforums.BlackBerry.com/T5/native-development/getting-color-count/m-p/2272391#M18324

Tags: BlackBerry Developers

Similar Questions

  • When I turn on my iPhone 6 screen shows only the background color, the icon usage and the reception icon.

    When I turn on my iPhone 6 screen shows only the background color, the icon usage and the reception icon.

    The iPhone's battery is fully charged?  Otherwise, load it, and then try again.

    If it is busy, go in recovery mode as explained here.  You may need to try to get into the mode of recovery once more to succeed.

    If you are unable to update or restore your iPhone, iPad or iPod touch - Apple supports

  • Coloring a font with a RGB, etc. without adding color in the swatch of the document.

    Is it possible to color a font with a RGB, Lab, or CMYK color without adding color in the swatch of the document.

    The only way I know is to add a color to the color chart or use an existing one.

    as

    App.Selection [0]. Characters [0]. FillColor = document. Colors.Add ({colorValue: 255, 53 (160) and space: ColorSpace.RGB}) ;}

    As a side effect to clutter up shades using many colors.

    any ideas?

    Hello Uwe!

    After 03:00 by me 02:00 by you

    I tried the link and it download but I have cs5 cs6 and cc but not cs5.5 and all the scripts worked on them can due to the conversion of files.

    It seems therefore that the following summary is all is correct

    New documents contain some

    Color chart (black, registration, paper and none) the index order is the order in which shades appear in the swatches Panel

    And the colors in the order of the alphabetical index

    named colors without name last and then 'A', 'Z' first color.

    Color documents News-[1] will be a color without a name that can be duplicated to produce other colors without name, noting that duplication should be processes and not the tones.

    So far so good, (not for long)

    Unnamed colors are not read only so if we make a positive effort to remove, we can do that.

    while (app.activeDocument.colors[-1].name == "") app.activeDocument.colors[-1].remove()
    

    Now, we will not have any what swatches without a name to duplicate and will have to use the method of file text marked with John at number 3 above.

    If there is no shade no name and we try to replicate the colors [-1] and it's a color as 'Yellow', then it seems s indesign crash.

    In any case the method below should always work (for regular non-dyed colours etc.).

    // optimized for easy of use but not efficiency !!!
    var doc = app.documents.add();
    var p = doc.pages[0];
    
    p.textFrames.add({contents: "RGB", geometricBounds: ["0mm", "0mm", "30mm", "30mm"], fillColor: addUnnamedColor([0, 0,255])}); // will be a RGB
    p.textFrames.add({contents: "RGB", geometricBounds: ["0mm", "30mm", "30mm", "60mm"], fillColor: addUnnamedColor([0, 255,0], 1666336578)}); // will be a RGB because of value
    p.textFrames.add({contents: "RGB", geometricBounds: ["0mm", "60mm", "30mm", "90mm"], fillColor: addUnnamedColor([65, 50, 102], ColorSpace.RGB)}); // will be a RGB
    p.textFrames.add({contents: "RGB", geometricBounds: ["0mm", "90mm", "30mm", "120mm"], fillColor: addUnnamedColor([84, 90,40],"r")}); // will be a RGB
    p.textFrames.add({contents: "RGB", geometricBounds: ["0mm", "120mm", "30mm", "150mm"], fillColor: addUnnamedColor([232, 0, 128],1)}); // will be a RGB
    
    p.textFrames.add({contents: "Lab", geometricBounds: ["30mm", "0mm", "60mm", "30mm"], fillColor: addUnnamedColor([29.5, 67.5, -112])}); // will be a Lab because of -
    p.textFrames.add({contents: "Lab", geometricBounds: ["30mm", "30mm", "60mm", "60mm"], fillColor: addUnnamedColor([100, -128, 127], 1665941826)}); // will be a Lab because of value
    p.textFrames.add({contents: "Lab", geometricBounds: ["30mm", "60mm", "60mm", "90mm"], fillColor: addUnnamedColor([24.5, 16, -29], ColorSpace.LAB)}); // will be a Lab
    p.textFrames.add({contents: "Lab", geometricBounds: ["30mm", "90mm", "60mm", "120mm"], fillColor: addUnnamedColor([36.8, -9, 27],"l")}); // will be a Lab
    p.textFrames.add({contents: "Lab", geometricBounds: ["30mm", "120mm", "60mm", "150mm"], fillColor: addUnnamedColor([51, 78, 0], -1)}); // will be a Lab because of the 1
    
    p.textFrames.add({contents: "CMYK", geometricBounds: ["60mm", "0mm", "90mm", "30mm"], fillColor: addUnnamedColor([82, 72, 0, 0])}); // will be a CMYK because there are 4 color values
    p.textFrames.add({contents: "CMYK", geometricBounds: ["60mm", "30mm", "90mm", "60mm"], fillColor: addUnnamedColor([60, 0, 100, 0], 1129142603)}); // will be a CMYK because of value
    p.textFrames.add({contents: "CMYK", geometricBounds: ["60mm", "60mm", "90mm", "90mm"], fillColor: addUnnamedColor([84, 90,40, 0], ColorSpace.CMYK)}); // will be a CMYK
    p.textFrames.add({contents: "CMYK", geometricBounds: ["60mm", "90mm", "90mm", "120mm"], fillColor: addUnnamedColor([67, 53, 97.6, 21.7], "c")}); // will be a CMYK
    p.textFrames.add({contents: "CMYK", geometricBounds: ["60mm", "120mm", "90mm", "150mm"], fillColor: addUnnamedColor([0, 100, 0, 0], 0)}); // will be a CMYK
    
    function addUnnamedColor (cValue, space, docToAddColor) {
        docToAddColor = app.documents.length && (docToAddColor || (app.properties.activeDocument && app.activeDocument) || app.documents[0]);
        if (!docToAddColor) return;
        var lastColor = docToAddColor.colors[-1];
        if (!cValue) cValue = [0,0,0,0];
        if (space == 1129142603 || cValue && cValue.length == 4) space = ColorSpace.CMYK;
        else if ((space && space < 0) ||  space && space == 1665941826 || (space && /L|-/i.test(space.toString())) || (cValue && /-/.test(cValue ))) space = ColorSpace.LAB;
        else if ((space && space > 0) || space && space == 1666336578 || (space && /R/i.test(space.toString())) || (cValue && cValue.length == 3)) space = ColorSpace.RGB;
        else space = ColorSpace.CMYK;
        app.doScript (
            """
            var newUnnamedColor = (lastColor.name == "") ? lastColor.duplicate() : taggedColor();
            newUnnamedColor.properties = {space: space, colorValue: cValue};
            """,
            ScriptLanguage.javascript,
            undefined,
            UndoModes.FAST_ENTIRE_SCRIPT
        );
    
         function taggedColor() { // need to use this if no unnamed exists
                 var tagString = "\r " : "WIN>\r ") + ""; // would make more sense to apply the correct value in the tagged text file but I can't be bothered !
                 var tempFile = new File (Folder (Folder.temp) + "/ " + (new Date).getTime() + ".txt");
                 tempFile.open('w');
                 tempFile.write(tagString);
                 tempFile.close();
                 var tempFrame = docToAddColor.pages[-1].textFrames.add();
                 $.sleep(250);
                 tempFrame.place(tempFile);
                 tempFrame.remove();
                 tempFile.remove();
    
             return docToAddColor.colors[-1];
    
         }
    
        return newUnnamedColor;
    }
    

    Apply the function to remove and replace swatch on the other thread both healthier of mind

    Concerning

    Trevor

  • I can't create a shortcut to the site on my desktop, when I click on the url bar I can drag on the browser to open a new, but as I drag him on my desktop I get the circle with the line through it, one that looks like a no entry sign. Help?

    I can't create a shortcut to the site on my desktop, when I click on the url bar I can drag on the browser to open a new, but as I drag him on my desktop I get the circle with the line through it, one that looks like a no entry sign. Help

    Try to drag the image to id web site (favicon) on the left side of the address bar, instead of the URL.

  • Satellite L500-19F: where can I get new hardware components

    Hello, sorry for my English, I am from the Germany.

    My notebook Satellite L500-19 is defect.
    Next few days I'll be watching, that things are missing...

    I think that its first of all the motherboard.

    Now my question: where can I get new hardware components for my laptop?
    Where I have to 'click' on the Web from Toshiba site?

    Thanks for the help!

    Hello

    All parts can be ordered from an ASP from Toshiba (certified partner) in your country.

    You will find here all the FSA all over the world:

    * http://eu.computers.toshiba-europe.com-> Support downloads &-> find an authorized Service provider *.

    Welcome them

  • I'm trying to get audio only from a video. I went to record audio only: (as shown) and there is no ' audio only ' click. do I have to upgrade the machine to live music, and if so, how?

    I'm trying to get audio only from a video. I went to record audio only: (as shown) and there is no ' audio only ' click. do I have to upgrade the machine to live music, and if so, how?

    If you are looking to get audio only from a YouTube video, all you need to do is read your video and while it's going to copy the link. Then on another tab, open listentoyoutube.com. Just follow the easy directions and paste the link.

    Hope that helps. I found out a month ago and I have 4 CD made from these audio files. There is a lot of fun to find obscure stuff and making CD of songs.

    Jon

  • video downloaded to my lap top from an SD card, cannot get picture only sound

    video downloaded to my lap top from an SD card, cannot get picture only sound

    Hi Pauline,

    as volunteer asked J format that the videos were saved is the most logical question here.

    All films registered as media of Windows, or MPEG, avi files, should be good.

    B Eddie

  • Whenever we want to print something, it must be moderately clean print nozzles to get it to print in color.

    Whenever we want to print something, it must be moderately clean print nozzles to get it to print in color. I know this isn't the print cartridge, it is the other, we tried. Any guess as to why?

    Contact the manufacturer of the printer.  It is their software, firmware printer or the printer hardware.

  • When I try to use Media player 11 or try to use live food of internet radio, I get nothing. When I search through the settings, I met a screen that says "no audio device".

    Original title: ideas: insert an error code or give a brief description of what you're trying to accomplish or difficult. _

    When I try to use Media player 11 or try to use live food of internet radio, I get nothing.  When I search through the settings, I met a screen that say, 'no audio device '.  I tried to update my card sound and nothing.

    Your help will be greatly appreciated.  If so, ask me questions and I will answer.

    Gary kenny

    theflyingelk

    (Number removed for privacy)

    (Email removed for privacy)

    Hi gary kenny,.
    1. when the question is is produced?
    2. the issue of 'No audio' intervene on other applications as well?
    3. What is the brand and model of your computer?
     
    Follow the steps and check if they help.
     
    Step 1:
     
    If you have HP and Compaq Windows XP computers, you can follow the steps mentioned in the article.
     
     
    Step 2:
     
    Or, you can uninstall and reinstall the sound drivers.
     
    a. click on START
    b. click Control Panel.
     
    You should have a few icons to come.
    If you do not, you must make sure that you have enabled the classic view.
     
    Locate the control panel option, it will be on the left side.
    Once activated the classic view
     
    Follow the rest of my instructions.
     
    c. click Device Manager
    d. sounds > search for your sound card (if you are not sure that your sound card is, post options and I'll tell you that one.)
    e. Note description brand / model, double-click on it, go to the tab drivers, note the version.
    f. make a right click on it and UNINSTALL it and restart the computer it will rebuild the driver stack.
    g. go to the manufacturers website and find the latest driver for your card download. (You must know the name of the sound card, if you wrote down from the above info), when you find it download: SAVE IT DO NOT HIT RUN (save it on your desktop for easy access.
    h. open the file that you have saved and right-click on it and select RUN AS ADMINISTRATOR(Now install it.). REBOOT after each installation of driver.
     
    Step 3:
     
    Sound drivers often rollback, so check that the version you just installed is always there. If not, the driver to keep until it sticks, it really shouldn't take more than three times

    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • I have a similar computer is trying to access e-mail remotely, but can't get "display only".

    I have a similar computer is trying to access e-mail remotely, but can't get "display only".  I tried to set up the computer, I try to access, by typing gpedit.msc, and it comes with a screen that says the file cannot be found.  I then went to the BASE of KNOWLEDGE AND HE has TOLD ME to FOLLOW THESE INSTRUCTIONS

    1. Click Startand then click run.
    2. In the Open box, type mmc, and then click OK.
    3. On the file menu, click on Add/Remove a snap.
    4. Click on Add.
    5. Under available stand-alone snap-ins, click Group Policy, and then click Add.
    6. If you do not want to edit the Local computer policy, click Browse to locate the Group Policy object you want. Supply your user name and password if prompted, and then when you return to the Select Group Policy object dialog box, click Finish.

    But at step 5 when he said, under -ins autonomous available, click Group Policy, THERE has BEEN NO GROUP POLICY click

    So that you can see, I'm at square one.  I went to this problem 12 hours over a period of 3 days.

    I wish you help!

    See my response to your thread in the other forum in which you've posted. There is no need to post to several forums; It's just more work for people who are trying to help you. If you need additional assistance, please post in the other thread.

    http://social.answers.Microsoft.com/forums/en-us/xpprograms/thread/9910d218-7fb6-4821-8986-d2648a247dfc MS - MVP - Elephant Boy computers - don't panic!

  • I'm trying to get my printer to make color

    I'm trying to get my printer to make color, it does not seem to matter what I cannot have to print in color. I had problems with the printer and may have changed the settings and I have no idea how to solve this problem. I went to the printer settings and went to the properties of the printer to color management, then I get lost. When I put my printer in (and I don't see why it's different) nothing changes. nothing I try makes no difference.

    Hello

    If you have changed the settings of the printer, on the whole, we can suggest is to uninstall, and then reinstall the printer that would about how it has been initially set up.

    People who can help you with the settings of the printer are the manufacturer of the printer, not Microsoft.

    Contact the manufacturer of the printer for assistance or try the Support Forums.

    See you soon.

  • Get the code of BlackBerry PIN through lines of command, or c# program

    Hi all

    Could you please suggest me the way to get the PIN of BlackBerry code through lines of command, or c# program. Either it's direct BlackBerry or BlackBerry device Simulator and which is connected by USB.

    You can use the javaloader.exe command-line tool to do this.  It is included with the JDE BlackBerry and BlackBerry Java plug-in for Eclipse.  The following command will do.

    JavaLoader u deviceinfo

  • Windows7 Desktop only shows black color whenever any substantive theme or Image are selected in the customization

    in my Windows7 Desktop only shows black color whenever any substantive theme or Image are selected in the customization. Plese geve me a solution

    Hi Odette.

    Thanks for posting your query on Microsoft Community forum.

    Question has started happening recently? If YES, did you of significant changes to the computer before this problem?

    The question could arise for various reasons, including corrupted cards, damaged TranscodedWallpaper.jpg file, Remove background images is selected in the Control Panel, etc. To diagnose and troubleshoot these causes of the problem, I suggest you try the steps outlined in the following link and check if the problem persists.

    Impossible to change the background image in Windows 7

    In addition, please refer to the steps provided by Shawn "Cmdr" Keene [MVP] replied on January 6, 2011 in the following thread link: "".

    I am unable to change the background of color United in my windows 7 ultimate

    Additional information:

    Why can't I change my desktop background?

    Hope this information is useful. Let us know if you need more help, we will be happy to help you.

  • HPDeskJet - series j610 only prints in color

    HPDeskJet - series j610 only prints in color - NO, I'm not ink

    Hello

    1. How you want to print? You try to print by using Internet Explorer?
    2. What program you use to print?
    3. The problem occurs with all the files you are trying to print? (To both online and offline files)
    4. You have all your drivers and software up to date for your printer?
    Method 1:
    You can open the printer Troubleshooter and check if it solves the problem:
    http://Windows.Microsoft.com/en-us/Windows7/open-the-printer-Troubleshooter
    Method 2:
    You can consult the section "include common choices, you will find in this dialog box" in the following article and check whether . Color or black and white (in grayscale) prints are on in black and white.
    Choose printing options
    Note:
    You can also consult the manual of the printer.
     
     
    I suggest you to contact HP and check out what they have to say on the issue:
     
     
     
    I hope this helps!
  • Get the only table name in model executing the revese engineer but columns do not come

    Get the only table name in model executing the revese engineer but columns do not come. I used the standard procedure.  Please let me know why I am not getting column in my model.

    I have attached the screen shot for the same thing.

    This is a table or a synonym? In the case of synonym or try to add the property as it appears below thread.

    Reverse engineering a synonym in ODI 11 G.

    Or maybe go with personal setbacks.

Maybe you are looking for