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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:56:48+00:00 2026-05-13T08:56:48+00:00

I am exploring an idea I had the other day. What if I would

  • 0

I am exploring an idea I had the other day.

What if I would allow the registered users on a website to pick their own colors for their comments and posts? This way the manifestation of their presence and personality would be stronger, and also it would be easier to spot (and ignore/ban) trouble-makers (#900 characters on #000 background). 😉

How could I still guarantee that their posts are still readable? Can you recommend relevant algorithms?

I am primarily looking for JavaScript and PHP solutions but other approaches could be useful as well.

  • 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-13T08:56:49+00:00Added an answer on May 13, 2026 at 8:56 am

    Very very nice formula for calculating the perceived brightness of a color. In order to ensure sufficient contrast make sure the difference in contrast values is above a certain threshold.

    Calculating the Perceived Brightness of a Color

    Example in C# (I know the original poster wanted a JavaScript solution – which I’m currently not very familiar with):

        bool ValidateContrast(Color foreColor, Color backColor)
        {
            double foreBrightness = CalcBrightness(foreColor), 
                   backBrightness = CalcBrightness(backColor);
            double threshold = 70; // Just a value, test this.
            bool enoughContrast = Math.Abs(foreBrightness - backBrightness) > threshold;
            return enoughContrast;
        }
    
        private double CalcBrightness(Color color)
        {
            double r = color.R, g = color.G, b = color.B;
            double brightness = Math.Sqrt(.241 * r * r + .691 * g * g + .068 * b * b);
            return brightness;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm exploring the idea of using contenteditable on a website at visitor comments and
I had an idea for an app that would periodically access peoples' Facebook data.
I got an really bad idea :) When exploring extension methods in vb I
I am exploring the idea of using professionally designed vector images as the ControlTemplates
I'm exploring the idea of subclassing NSCoder to read/write a proprietary file format. I'm
I am new to web service and I am exploring one particular idea regarding
I'm a newcomer to the idea of aspect-oriented programming but I would like to
I am exploring the idea of implementing a web service api using WCF Data
I'm exploring the idea of building a bridge between a DLL plugin for a
I'm exploring what transitions/effects are available for image switching. Main idea was to use

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.