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 7940121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:17:39+00:00 2026-06-03T23:17:39+00:00

I have an icon that I would like to display in an arbitrary hexadecimal

  • 0

I have an icon that I would like to display in an arbitrary hexadecimal number. The icon samples are below, but since the color can be anything, how would I color it in by feeding an HTML color? The background would have to be transparent since it is going to be a pinpoint on a map. Any idea on how to accomplish this?

enter image description here
enter image description here
enter image description here

  • 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-03T23:17:42+00:00Added an answer on June 3, 2026 at 11:17 pm

    Here is the approach I would use.

    You need to start with a version of that image that doesn’t have the color–just the black and white required for the outline, the bus, and the gradient. You’ll need the gradient to have alpha transparency so that some pixels are more transparent than others–then you can put any color behind the image, and the colors will change. Success!

    The problem is that this would overflow the borders of the pin and you’d lose the ability to have it overlay the map, so you need to find a way to clip the background item so that it is the exact shape of the pin and is transparent beyond the edges of that.

    You could try creating a simple SVG image that is the same shape and putting it behind it. I used this tool to create this orange circle:

    <?xml version="1.0" standalone="no"?>
    <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
    <ellipse cx="200" cy="190" rx="30" ry="30" style="fill:orange"/>
    </svg>
    

    With a little work you might be able to get the shape to match your pin and then when you place it behind your transparent image, all you need to do is use Javascript or whatnot to change the text from “fill:orange” to whatever color you want.

    Another similar approach would be to use the canvas element to draw that shape. You could also try getting creative with CSS border rounding and rotating to make that shape, depending on what your browser support is. Here is a css-generated pin that is close to the shape you need, though not quite there yet: (obviously, code is webkit specific)

    ​<div style="background-color: blue; -webkit-transform: rotate(-45deg); width:100px; height:100px; border-radius: 50px 60px 50px 0;"></div>
    

    If you wanted to do something that would work in older browsers, you could create a bunch of divs that are all 1px high of varying lengths to create something exactly the size of your transparent pin.

    <div class="constructedPin">
        <div style="width: 8px"></div>
        <div style="width: 12px"></div>
        <div style="width: 30px"></div>
        <div style="width: 35px"></div>
        <div style="width: 38px"></div>
        <div style="width: 40px"></div>
        <div style="width: 41px"></div>
                     (etc...)
    </div>
    
    <style>
     div.constructedPin div { height: 1px; background-color:whatever; margin: auto;}
    </style>
    

    Then it’s a simple matter of changing the background color of the divs. This approach sounds complicated but it wouldn’t be too hard, and would actually load really quickly since you can hard-code the divs, no generating on the fly, and the CSS update would be lightening-fast.

    [edit:]
    I got carried away and made a little demo. Obviously it would work better if you had a real image–I just quickly erased the color from it to get the idea across.

    http://jsfiddle.net/eNfak/8/

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

Sidebar

Related Questions

I would like to create a simple notification icon that would display a number
I have an icon that I would like to be able to drop into
I simply would like to display icon that is in fixed location in MapView.
I have a fixed-position image that I would like to fade out when scrolling
I understand that Javascript doesn't have multiple threads, but I'd like to know if
I would like to create links that have icons included in the link. For
I have a tableview that has groups. I would like to add a dummy
I have an icon that is inserted into a page using the background-image property.
I have a home-screen widget that has an icon that starts/so pose to bring
I have created a nice icon for my app that quite accurately reproduces the

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.