Set Shell colors transparent

I'm trying to make the top bar (currently blue) transparent while using shell, my intention is to make that transpose from white to transparent after some scrolling, I have no problem to change the color to any solid color but can't set it to transparent I've done most of the methods listed in the documentation without success, whenever I set a transparent color it turns blue

    //This code is at a different page from appshell
    Color topBar = new Color(0,0,0,0.1);
    Shell.SetShellBackgroundColor(this, topBar);

Answers

  • jointothedarksidejointothedarkside Member ✭✭

    Here's a picture since I'm new here I cant post the link for the screen capture

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    new Color(0,0,0,0.1);

    Yeah... no.

    You should read up on how to define a color.. or even the definition of colors before trying to blindly guess how they work.
    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/colors

    Same Color class used for decades and it does not include fractional values like that.

  • jointothedarksidejointothedarkside Member ✭✭

    Same result I did use Color topBar = new Color(255,255,255,0); or Color topBar = Color.Transparent and it turns blue, in Unity 3D you can use the RGBA input in such way thought here could apply too (white Solid white. RGBA is (1, 1, 1, 1).)

  • JoeMankeJoeManke USMember ✭✭✭✭✭

    @ClintStLaurent said:

    new Color(0,0,0,0.1);

    Yeah... no.

    You should read up on how to define a color.. or even the definition of colors before trying to blindly guess how they work.
    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/colors

    Same Color class used for decades and it does not include fractional values like that.

    The Xamarin.Forms.Color constructors do take fractional values (clamped from 0.0 to 1.0) - see https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.color.-ctor?view=xamarin-forms

    The factory methods Color.FromRgb and Color.FromRgba accept both doubles (again, clamped between 0.0-1.0) or ints (0-255).

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    yes. Color.Fromxxx but not new Color(0,0,0,0.1)

    I stand corrected.

    That's the most screwed up thing I've ever seen. Coming from years of dealing with color as 0-255 ARGB to the point where my greenscreen algorithms are licensed and in use still... doing things in some other way just to confuse people is whacked and asking for confusion. see the current thread as an example.

    Color.Transparent and it turns blue,

    Are you sure its blue? And not just transparant showing blue from something underneath?

    Screenshots really would do wonders to help people see what is very much a visual issue.

  • jointothedarksidejointothedarkside Member ✭✭

    There's a still of the screen on the second comment, as I mentioned I'm using SHELL I guess the blue bar is android default nav because I changed the color from the style and it seems to be that one but how do I get rid of that, shouldn't be abscent if I'm using shell?

Sign In or Register to comment.