Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
CSS image filters
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric H. Jung  
View profile  
 More options May 17 2008, 4:46 pm
Newsgroups: mozilla.dev.extensions
From: "Eric H. Jung" <eric.j...@yahoo.com>
Date: Sat, 17 May 2008 13:46:12 -0700 (PDT)
Local: Sat, May 17 2008 4:46 pm
Subject: CSS image filters
Hi,

This isn't really extension-specific, but it's for use within an extension so I'm asking it here. Is there any way to dynamically change the color of statusbar icon (gif or png) without including individual graphic files for all possible color permutations?

Thanks for any help,
Eric


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philip Chee  
View profile  
 More options May 18 2008, 11:26 am
Newsgroups: mozilla.dev.extensions
From: Philip Chee <philip.c...@gmail.com>
Date: Sun, 18 May 2008 23:26:16 +0800
Local: Sun, May 18 2008 11:26 am
Subject: Re: CSS image filters

On Sat, 17 May 2008 13:46:12 -0700 (PDT), Eric H. Jung wrote:
> This isn't really extension-specific, but it's for use within an
> extension so I'm asking it here. Is there any way to dynamically
> change the color of statusbar icon (gif or png) without including
> individual graphic files for all possible color permutations?

You could have a PNG with a transparent background and then change the
background colour of the containing element via JS.

The other solution I've seen an extension use, is to fetch the icon from
the authors website with the colour encoded in the URLs query
parameters. The website PHP would then dynamically generate an icon with
the requisite colour and return that.

Hmm. I suppose you could use canvas to generate your icon/image, convert
it to a data url and then attach it to your statusbar icon.

Phil

--
Philip Chee <phi...@aleytys.pc.my>, <philip.c...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Too Many Programmers In This Area. Please, ZIP Yourself...
* TagZilla 0.066.6


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric H. Jung  
View profile  
 More options May 18 2008, 5:59 pm
Newsgroups: mozilla.dev.extensions
From: "Eric H. Jung" <eric.j...@yahoo.com>
Date: Sun, 18 May 2008 14:59:44 -0700 (PDT)
Local: Sun, May 18 2008 5:59 pm
Subject: Re: CSS image filters

Thanks for the ideas. I'm not fond of the first one because it's only the background color I can change. I'm really looking to change the hue/tint of the entire image. I'll consider the second idea. The third is appealing, but I have two follow-up questions:

1. Where could I place the <canvas/> so it wouldn't be visible to the user? (Please don't say the hidden window)
2. How could I convert the canvas to a data url?

Thanks,
Eric


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mook  
View profile  
 More options May 18 2008, 6:45 pm
Newsgroups: mozilla.dev.extensions
From: Mook <mook.moz+nntp.news.mozilla....@gmail.com>
Date: Sun, 18 May 2008 15:45:51 -0700
Local: Sun, May 18 2008 6:45 pm
Subject: Re: CSS image filters

Eric H. Jung wrote:
>> From: Philip Chee <philip.c...@gmail.com>
<snip>
>> Hmm. I suppose you could use canvas to generate your icon/image, convert
>> it to a data url and then attach it to your statusbar icon.

> Thanks for the ideas. I'm not fond of the first one because it's only the background color I can change. I'm really looking to change the hue/tint of the entire image. I'll consider the second idea. The third is appealing, but I have two follow-up questions:

> 1. Where could I place the <canvas/> so it wouldn't be visible to the user? (Please don't say the hidden window)
> 2. How could I convert the canvas to a data url?

> Thanks,
> Eric

Randomly playing in DOM Inspector gets me:
<statusbarpanel>
   <stack>
     <box>
       <label />
       <image image" width="16" height="16"
              src="chrome://greasemonkey/content/icon_small.png"/>
     </box>
     <box mousethrough="always"
          style="background-color: #ff0000; opacity: 0.3;"/>
   </stack>
</statusbarpanel>
Note that this covers the whole rectangular area, not just the bits of
the icon that is not transparent.

As for canvas - feel free to place it right inside the statusbarpanel,
with width= and height= attributes set, but style="display:none;".  The
canvas size is independent of the element size.  Get the url via
document.getElementById("canvas-id").toDataURL() (returning a string).

HTH

--
Mook


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric H. Jung  
View profile  
 More options May 18 2008, 8:16 pm
Newsgroups: mozilla.dev.extensions
From: "Eric H. Jung" <eric.j...@yahoo.com>
Date: Sun, 18 May 2008 17:16:46 -0700 (PDT)
Local: Sun, May 18 2008 8:16 pm
Subject: Re: CSS image filters

----- Original Message ----
> From: Mook <mook.moz+nntp.news.mozilla....@gmail.com>
> Randomly playing in DOM Inspector gets me:
> Note that this covers the whole rectangular area, not just the bits of
> the icon that is not transparent.

> As for canvas - feel free to place it right inside the statusbarpanel,
> with width= and height= attributes set, but style="display:none;".  The
> canvas size is independent of the element size.  Get the url via
> document.getElementById("canvas-id").toDataURL() (returning a string).

I love my MOOK! Everyone should have his own mook! Remind me to get my MOOK a nice Christmas present.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google