Xamarin.Formsにおける色指定の方法(C#、Xaml)
これはXamarin.Formsにおける色指定の方法です.
備忘録
Xamlでの色指定
Xamlで色指定する場合は、ビルトインの色名、RGB値、アルファ値(透明度)つきRGB、TinyRGB、アルファ値つきTinyRGBで指定できる。
<Label Text="Sea color" BackgroundColor="Aqua" />
<Label Text="RGB" BackgroundColor="#00FFFF" />
<Label Text="Alpha plus RGB" BackgroundColor="#2200FFFF" />
<Label Text="Tiny RGB" BackgroundColor="#0FF" />
<Label Text="Tiny Alpha plus RGB" BackgroundColor="#C0FF" />
C#での色指定
C#でも同じように色名(構造体)や16進表記(文字列)で指定できる。
var label = new Label();
label.BackgroundColor=Color.Aqua;
label.BackgroundColor = Color.FromHex("#00FFFF");
label.BackgroundColor = Color.FromHex("#2200FFFF");
label.BackgroundColor = Color.FromHex("#0FF");
label.BackgroundColor = Color.FromHex("#20FF");
他にも
label.BackgroundColor = Color.FromRgb(0x00, 0xff, 0xff);
label.BackgroundColor = Color.FromRgb(0x00, 0xff, 0xff,0x22);
Author And Source
この問題について(Xamarin.Formsにおける色指定の方法(C#、Xaml)), 我々は、より多くの情報をここで見つけました https://qiita.com/shuhey/items/32726c74c73ef0447348著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .