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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:54:25+00:00 2026-05-30T23:54:25+00:00

I was trying to code up some color manipulation code and was stuck for

  • 0

I was trying to code up some color manipulation code and was stuck for a long time with alpha, then I (2 hours later) realized browsers render rgba differently.

I created this test: http://jsbin.com/adekez/2/
add /edit to look at the code

Here are the results in 4 browsers in OSX Lion: https://i.stack.imgur.com/i9wSw.jpg

That is an element with a background of rgba(0,0,0,0.5) on top of white.

My hex calculator says: FF÷2 = 7F.8 which means

Safari at #808080 is correct
Firefox at #7F7F7F is off by 1
Opera at #7E7E7E is off by 2
Chrome at #929292 is way off

What’s going here, is this a bug in Chrome or do I just not know about colors (true)?

  • 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-30T23:54:26+00:00Added an answer on May 30, 2026 at 11:54 pm

    First off

    Well, actually Safari and Firefox are both correct:
    0xFF = 255, 255 / 2 = 127.5. So 128 may be correct (0x80), but also 127 (0x7F) – depending on the rounding convention of the browser.

    Explantion of the issue

    These are rounding issues. I don’t quite get why there are rounding issues, since 0.5 is representable in binary numbers without precision loss, but there are, in fact rounding issues:

    Opera:
    Opera Screenshot

    Chrome:
    Chrome Screenshot

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

Sidebar

Related Questions

I'm trying to write some code that will render a texture onto a simple
I am writing some code and trying to speed it up using SIMD intrinsics
Trying to truncate some code here and running into a problem: <script type=text/javascript> $(function()
There is some code that I'm trying to convert from IList to IEnumerable :
I'm trying to convert some code that worked great in VB, but I can't
I'm trying to generate some code at runtime where I put in some boiler-plate
I'm trying to get some code working that a previous developer has written. Yep,
I was running some dynamic programming code (trying to brute-force disprove the Collatz conjecture
I'm trying to write some code to find a specific XmlNode object based on
I am trying to generate some code at runtime using the DynamicMethod class in

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.