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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:35:46+00:00 2026-06-15T05:35:46+00:00

Should these two expressions result in colors which are roughly the same? Color.FromArgb(255, 255,

  • 0

Should these two expressions result in colors which are roughly the same?

Color.FromArgb(255, 255, 255, (byte)0.25 * 255))

Color.FromScRgb(1.0f, 1.0f, 1.0f, 0.25f))

This test program demonstrates that they show up with seemingly different alpha values:

using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;

namespace Test_FromArgb_FromScRbg
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            var panel = new StackPanel();

            Content = panel;

            panel.Children.Add(
                new Rectangle()
                {
                    Width = 100,
                    Height = 100,
                    Fill = new SolidColorBrush(
                        Color.FromArgb(
                            255, 
                            255, 
                            255, 
                            (byte)0.25 * 255))
                });

            panel.Children.Add(
                new Rectangle()
                {
                    Width = 100,
                    Height = 100,
                    Fill = new SolidColorBrush(
                        Color.FromScRgb(
                            1.0f,
                            1.0f,
                            1.0f,
                            0.25f))
                });
        }
    }
}

Here’s what the demo program looks like on my system:

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-15T05:35:47+00:00Added an answer on June 15, 2026 at 5:35 am

    The basic reason behind this is mentioned by mzzzzb above:

    the scale 0.0 – 1.0 does not map linearly to 0 – 255

    I.e. the ScRgb components do not map linearly to the Argb components.

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

Sidebar

Related Questions

Why the result of these two expressions should be different ? The same thing
Starting Situation These two commands should be equivalent. jQuery('a').filter(':contains(about)'); and jQuery.find('a').filter(':contains(about)'); Problem In fact,
I have two things I need this for, these should explain what I mean:
Is there any difference in speed/memory usage for these two equivalent expressions: Regex.IsMatch(Message, 1000)
jQuery autocomplete docs state there should be two Models, the first being the model
Is there any difference between the following two examples and should one be preferred
How to develope an efficent job scheduling with constraints?? The scheduler should include these
Should I provide these things by default or only on client request (if they
I've read multiple examples on how these queries should be written but I'm struggling
arr=Array.new(3) arr[0]=5 arr[1]=3 arr[2]=2 These lines should call this function, https://github.com/ruby/ruby/blob/trunk/array.c#L568 according to this,

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.