Again, bolted some existing scripts together:

Again, bolted some existing scripts together:

QUICK-THEME

]]>

12 Commentsto Again, bolted some existing scripts together:

  1. Anonymous says:

    < ![CDATA[

    /* About the script


    * Purpose : set the background color of an item with colors extracted from the wallpaper


    * Author : Pierre Hébert / Jappie Toutenhoofd


    */



    LL.bindClass(“android.app.WallpaperManager”);



    var MyItem = LL.getEvent().getItem();


    var background = MyItem.getBoxBackground(“n”);


    var xe = MyItem.getProperties();


    var bordersize = xe.getBox(“i.box”).getSize(“bl”);


    var labelsize = xe.getFloat(“s.labelFontSize”);


    var labelfont = xe.getString(“s.labelFontTypeFace”);


    var labelstyle = xe.getString(“s.labelFontStyle”);


    var labelshadow = xe.getBoolean(“s.labelShadow”);


    var shadowradius = xe.getFloat(“s.labelShadowRadius”);


    var offsetx = xe.getFloat(“s.labelShadowOffsetX”);


    var offsety = xe.getFloat(“s.labelShadowOffsetY”);



    try {


    // extract the wallpaper bitmap


    var wp = WallpaperManager.getInstance(LL.getContext()).getDrawable();


    var bitmap = wp.getBitmap();



    Palette.generateAsync(bitmap, {


    onGenerated: function(palette) {


    var container = LL.getEvent().getContainer();


    run(container


    , palette.getLightMutedColor(0)


    , palette.getDarkMutedColor(0)


    , palette.getVibrantColor(0)


    , palette.getLightVibrantColor(0)


    );


    Android.makeNewToast(“Done”, true).show();


    }


    }).execute(null);


    } catch (e) {


    e.printStackTrace();


    // no bitmap or OOM


    }



    function Aclr(alfa, clr) {


    var r = Color.red(clr);


    var g = Color.green(clr);


    var b = Color.blue(clr);


    return Color.argb(alfa, r, g, b);


    }



    function run(cont, clr1, clr2, clr3, clr4) {



    var items = cont.getItems();



    for (var i = items.getLength() – 1; i >= 0; –i) {


    var item = items.getAt(i);


    if (item.getTag(“QT”) === null || item.getTag(“QT”) !== “notheme”) {


    item.setBoxBackground(background, “n”, true); var ed = item.getProperties().edit();



    var box = ed.getBox(“i.box”);


    box.setColor(“c”, “n”, Aclr(158, clr1));


    box.setColor(“c”, “s”, Aclr(255, clr2));


    box.setColor(“bl,br,bt,bb”, “ns”, Aclr(158, clr2));


    box.setSize( “bl,br,bt,bb”, bordersize );



    if (item.getType() == “Folder” || item.getType() == “Shortcut”) {


    ed.setInteger(“s.labelFontColor”, Aclr(255, clr3));


    ed.setInteger(“s.iconColorFilter”, Aclr(0, clr3));


    // ed.setFloat(“s.labelFontSize”, labelsize);


    ed.setString(“s.labelFontTypeFace”, labelfont);


    ed.setString(“s.labelFontStyle”, labelstyle);


    ed.setBoolean(“s.labelShadow”, labelshadow);


    ed.setFloat(“s.labelShadowRadius”, shadowradius);


    ed.setFloat(“s.labelShadowOffsetX”, offsetx);


    ed.setFloat(“s.labelShadowOffsetY”, offsety);


    ed.setInteger(“s.labelShadowColor”, Aclr(255, clr4));


    }


    ed.commit();


    }


    if (item.getType() == “Folder” || item.getType() == “Panel”) {


    run(item.getContainer(), clr2, clr1, clr4, clr3);


    }


    }



    }

    ]]>

  2. Anonymous says:

    < ![CDATA[

    set as shortcut run-script

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Interesting and Testing. 🙂

    ]]>

  4. Anonymous says:

    < ![CDATA[

    en?

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Hi, this is pretty cool, but you do not want to hide buttons for sidebar on that desktop (if you only want to trigger that by swipe), because they show up when getting the same background color as the rest of the items.



    And if they are on top of each other, the color “multiplies” on that spot. So you see where they’re hidden. Also tested with wallpapers that are not quiet, they contain a lot of things on the entire wallpaper, the text on my items are hard to read because the item background is too much translucent. (I use calendar script, calendar in text item)



    So if you use “quiet” wallpapers that contain a little free space for your text and a other part that contains more colors then it is do-able.


    For some situations the background of the items may be darker so you can see the item icons and the text better.



    Sometimes I love to choose the colors that are used myself (that are picked from wallpaper)



    But, this is (a) pretty cool (beginning). Thumbs up!

    ]]>

  6. Anonymous says:

    < ![CDATA[

    thank for the analysis !


    ** on hidden items:


    hide them with edit-misc.-transparency.



    ** no theme with:



    var i = LL.getEvent().getItem();


    i.setTag(“QT”, “notheme”);



    in a separate script, on item.



    ** busy wallpapers & color stacking:


    i plan a configurable transparency

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Until now I only hide it with disable icon and disable text. No transparency needed. Haha. Also some times the text is hard to read when text is small and containing shadow.



    Yesterday evening I had a nice wallpaper, mostly black but blue and pink android in it. The text in the text item is pink and the shadow is blue.


    Thats hard to read.


    When throwing that same text field in a panel, the text stays pink and the background, I think panel but I didn’t check, turns blue like shadow color. Better for reading. 🙂 didn’t check if that is supposed to do that.

    ]]>

  8. Anonymous says:

    < ![CDATA[

    I deleted the panel with Callender item, and made a new one. Text now first: pink text and blue shadow. When throwing it in a panel the text is blue and text shadow is blue. Background of panel is same as rest of the items. But the background of text item in the panel looks like it contains a blue-ish glow on it.

    ]]>

  9. Anonymous says:

    < ![CDATA[

    this is intentionally. could make it optional.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Shadow of the text as option could be nice if you want no shadow and if you want for specific items no shadow, you can disable it later in the settings for that item.


    Or option to choose for shadow color to be used as background color?

    ]]>

  11. Anonymous says:

    < ![CDATA[

    hhhm, ok. I’ll make a ‘not-so-quick-theme” or rename this to “too-quick-theme’ 😉

    ]]>

  12. Anonymous says:

    < ![CDATA[

    I’ve been testing this, and noticed that when an item is not in a panel then the background is white translucent/transparent after running the script .



    And when an item is in a panel, the background of the panel is the same white translucent/transparent color, but the item background in the panel gets a translucent/transparent color of the color that is the text shadow.



    That makes the text allot better to read. The problem might be something with the background color. For text items are better to read when they are placed inside of a panel or a map.



    Edit: mostly when item is not in a panel then the background is white translucent/transparent, just now I had a dark one but text is still blurry. I will send screen shots in Hangout.

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *