Inkscape.org
Beginners' Questions Set QR Code color via RGB
  1. #1
    zontarr zontarr @zontarr

    I see how to change a QR Code color via the preset color choices, how I can enter an RGB value and change it to that?ย 

  2. #2
    David248 David248 @David248

    [using 1.3]

    I didn't see color presets in the window of the extension > Render > Barcode > QR code. Once created, the QR-code is actually a group consisting of :

    • a background rectangle with a white fill,
    • a path above the background : the QR code itself : its color fill can be changed the way you do for any path : using Fill and Stroke panel (ctrl+shift+ F) : here you can set the exact RGB values you wish.
  3. #3
    zontarr zontarr @zontarr

    ย Thanks! Still having trouble though. I've ungrouped, but when I set the RGB color it does both the QR code and the surrounding color, want to keep that clear (or white) and just set the QR code itself to a particular RGB value, don't see how to select theย 'layer' / object.ย 

  4. #4
    inklinea inklinea @inklineaโ›ฐ๏ธ

    Inย render_barcode_qrcode.py

    qrg = grp.add(Group())
    qrg.style["stroke"] = "none"
    # qrg.style["fill"] = "white" if self.invert_code else "black"
    qrg.style["fill"] = "white" if self.invert_code else "rgb(255, 200, 55)"
    qrg.add(drawer())

    Hashed (#) line is the original, line below is the edit.

  5. #5
    David248 David248 @David248
    *

    @zontarr :

    In the extension window, you can give a convenient name for the group that will be created (In the "Group ID" Textfield). Let's say "QR_code" for example.

    1. Once created, open object panel (Ctrl+Shift+L in 1.3, maybe Ctrl+Shift + O in older versions, or just do Object > Layers and Objects).
    2. You can then expand the layer you're working in - "Layer1" for example - (click on the triangle left to the name of the layer), and find the group QR_Code in object panel. Expand itย  : you'll find two objects : ย a rectangle (Inkscape has automatically given to this rectangle a name "rect1" or something like that), and another object : actually a group, today, for me. Yesterday it seemed it was a path, but I may have written mistakes yesterday (sorry). This group is named like "g1" or something alike. Within this group, there is a path (let's say "path21") : the QR code itself.
    3. You can either select g1 or expand it and select the path21. Then, open Fill and stroke dialog and set Fill color. Don't modify stroke (set to none). If you've just selected the path, changes will be applied to the path, if the "g1" group is selected, changes will be applied to all objects within this group (as there is only one object inside for the moment, it just applies changes to the "path21", but you may want to add things inside this group).

    ย 

    Hope this helps.

    Notes :

    • to directly select on canvas objects within groups, you can hold Ctrl key. You can then check on status bar (bottom of the screen) what is selected : if it's a path with, say, 650 nodes it's your path21.
    • Using object panel will allow you to select locked objects.
  6. #6
    Polygon Polygon @Polygonโš–๐ŸŒถ

    @zontarr selection via "Layers and Objects" is easy to understand methinks: