Пример #1
0
        /// <summary>
        /// Convert a WebColor to a UnityEngine.Color
        /// </summary>
        /// <returns>UnityEngine.Color.</returns>
        /// <param name="color">The web color you wish to have returned in Unity format.</param>
        /// <param name="alpha">The alpha value of the color you want returned.</param>
        public static Color ToColor(WebColor color, float alpha)
        {
            Color newColor = ToColor(color);

            newColor = new Color(newColor.r, newColor.g, newColor.b, alpha);
            return(newColor);
        }
Пример #2
0
        public void TestGetBackgroundColor()
        {
            var home = Start();

            var webButton = home.GetWebButton().ByID("body_MyWebButton1Sync");

            Assert.That(webButton.StyleInfo.GetBackgroundColor(), Is.EqualTo(WebColor.FromRgb(221, 221, 221)));
        }
Пример #3
0
        /// <summary>
        /// Convert a WebColor to a UnityEngine.Color
        /// </summary>
        /// <returns>UnityEngine.Color.</returns>
        /// <param name="color">The web color you wish to have returned in Unity format.</param>
        public static Color ToColor(this WebColor color)
        {
            return(new Color(
                       (((int)color >> 16) & 0xFF) * HexInverse,
                       (((int)color >> 8) & 0xFF) * HexInverse,
                       ((int)color & 0xFF) * HexInverse

                       ));
        }
Пример #4
0
        public void TestCellGetBackgroundColor()
        {
            var home = Start();

            var bocList = home.GetList().ByLocalID("JobList_Normal");

            var cell1 = bocList.GetRow(1).GetCell(1);

            Assert.That(cell1.StyleInfo.GetBackgroundColor(), Is.EqualTo(WebColor.White));

            var cell2 = bocList.GetRow(2).GetCell(1);

            Assert.That(cell2.StyleInfo.GetBackgroundColor(), Is.EqualTo(WebColor.FromRgb(244, 244, 244)));
        }
Пример #5
0
        public override List <ElementProperty> GetElementPropertiesSnapshot(List <ElementProperty> list = null)
        {
            list = base.GetElementPropertiesSnapshot();

            list.Add(new ElementProperty("Gump Link", OnGumpLinkEntryUpdate, GumpLink.ToString(), ElementProperty.InputType.TextEntry));
            list.Add(new ElementProperty("Web Color", OnWebColorEntryUpdate, WebColor.ToString(), ElementProperty.InputType.TextEntry));
            list.Add(new ElementProperty("Text", OnTextEntryUpdate, Text.ToString(), ElementProperty.InputType.TextEntry));

            list.Add(new ElementProperty("Font Size", null, GumpLink.ToString(), ElementProperty.InputType.Blank));
            list.Add(new ElementProperty("   Large", OnFontLargeRadioButtonUpdate, string.Empty, ElementProperty.InputType.RadioButton, FontSize == FontHandling.FontSize.Large ? true : false));
            list.Add(new ElementProperty("   Medium", OnFontMediumRadioButtonUpdate, string.Empty, ElementProperty.InputType.RadioButton, FontSize == FontHandling.FontSize.Medium ? true : false));
            list.Add(new ElementProperty("   Small", OnFontSmallRadioButtonUpdate, string.Empty, ElementProperty.InputType.RadioButton, FontSize == FontHandling.FontSize.Small ? true : false));

            list.Add(new ElementProperty("Underlined", OnUnderlinedCheckboxUpdate, string.Empty, ElementProperty.InputType.Checkbox, Underlined));
            list.Add(new ElementProperty("Italicized", OnItalicizedCheckboxUpdate, string.Empty, ElementProperty.InputType.Checkbox, Italicized));
            list.Add(new ElementProperty("Bold", OnBoldCheckboxUpdate, string.Empty, ElementProperty.InputType.Checkbox, Bold));

            return(list);
        }
Пример #6
0
        public override object Clone()
        {
            var link = new HyperLinkElement
            {
                ElementType = ElementType.Clone() as string,
                Name        = Name.Clone() as string,
                X           = X,
                Y           = Y,
                Z           = Z,
                GumpLink    = (string)GumpLink.Clone(),
                WebColor    = (string)WebColor.Clone(),
                Text        = (string)Text.Clone(),
                Underlined  = Underlined,
                Italicized  = Italicized,
                Bold        = Bold,
                FontSize    = FontSize
            };

            return(link);
        }
Пример #7
0
 /// <summary>
 /// Convert a WebColor to a UnityEngine.Color
 /// </summary>
 /// <returns>UnityEngine.Color.</returns>
 /// <param name="color">The web color you wish to have returned in Unity format.</param>
 /// <param name="alpha">The alpha value of the color you want returned.</param>
 public static Color ToColor(WebColor color, float alpha)
 {
     Color newColor = ToColor (color);
                 newColor = new Color (newColor.r, newColor.g, newColor.b, alpha);
                 return newColor;
 }
Пример #8
0
 public ColorfulThing()
 {
     Color = new WebColor("#00ff00");
 }
Пример #9
0
 public ColorfulThing()
 {
     Color = new WebColor("#00ff00");
 }
 public void AddRectangle(float x, float y, float width, float height, string webColor)
 {
     Color fillcolor = new WebColor(webColor);
     _currentPage.Elements.Add(new Rectangle(x, y, width, height, RgbColor.White, fillcolor));
 }
 public void AddRectangleBlueTitle(float x, float y, float width, float height)
 {
     Color fillcolor = new WebColor("#218AB7");
     _currentPage.Elements.Add(new Rectangle(x, y, width, height, RgbColor.White, fillcolor));
 }