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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:43:49+00:00 2026-05-22T20:43:49+00:00

I have a color hex string stored in the database like 0x78dce6b0 ; I

  • 0

I have a color hex string stored in the database like 0x78dce6b0; I can convert this to an ARGB color using:

string colorString=0x78dce6b0;
int hexColor = Convert.ToInt32(colorString ?? "0", 16);
Color colorTL = Color.FromArgb(hexColor);

Now I want to convert this to use in an HTML page, so I need to convert into an HTML value like #cc3388. If I directly convert using ColorTranslator.ToHtml(colorTL), I lose the alpha blending value. How do I convert it by taking into consideration the alpha value, assuming the background is always white?

  • 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-05-22T20:43:49+00:00Added an answer on May 22, 2026 at 8:43 pm

    HTML Colors do not have an Alpha component.

    Unfortunately it is impossible to convert ARGB to HTML RGB without losing the Alpha component.

    If you want to blend your color with white, based upon your alpha value…

    • Convert each Hex component (A, R, G, B) into a value from 0 to 255, where a value of FF equates to 255, 00 equates to 0.
    • We’ll name these 0-255 values, A, R, G, B
    • We’ll assume that an Alpha value of 255 means “fully transparent” and an Alpha value of 0 means “fully opaque”
    • New_R = CInt((255 – R) * (A / 255.0) + R)
    • New_G = CInt((255 – G) * (A / 255.0) + G)
    • New_B = CInt((255 – G) * (A / 255.0) + B)
    • Your final HTML color string will be: “#” & cstr(New_R) & cstr(New_G) & cstr(New_B)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a variable using System.Windows.Media.Color. I can display the Hex value from
I'm using jPicker ,I have 2 Questions. 1.How can I change the color to
Can we have alternate Row color to GtkMenu items? and how to increase menu
I need to have a JQuery color Picker, where I can change the different
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
I have a device that supports 4-color graphics (much like CGA in the old
I've been fighting this all day. Inside my styles.xml file I have color information
I'm taking a hex color value received as a string and converting it to
I have a color in hex format ex (c3d8f7 (light blue), 303f5a (dark blue)).
I have an array of hex color codes and want to loop through them

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.