• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Colour类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Colour的典型用法代码示例。如果您正苦于以下问题:C# Colour类的具体用法?C# Colour怎么用?C# Colour使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Colour类属于命名空间,在下文中一共展示了Colour类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: WhenGivenDifferentValues_ReturnsFalse

            public void WhenGivenDifferentValues_ReturnsFalse()
            {
                var x = new Colour(0f, 1f, 0f);
                var y = new Colour(360f, 1f, 1f);

                x.Equals(y).Should().BeFalse();
            }
开发者ID:BraveSirAndrew,项目名称:mercury-particle-engine,代码行数:7,代码来源:ColourTests.cs


示例2: Block

 public Block(Axis axis, Colour colour)
     : this(new List<Tuple<Axis, Colour>>()
     {
         new Tuple<Axis, Colour>(axis, colour)
     })
 {
 }
开发者ID:JakeColtman,项目名称:Kill-Sudoku-Solver,代码行数:7,代码来源:Block.cs


示例3: Player

        /// <summary>
        /// Player
        /// </summary>
        /// <param name="aPlayerName"></param>
        /// <param name="aLocation"></param>
        public Player(string aPlayerName, Location3i aLocation)
            : base()
        {
            // Create the players key-chain
            KeyChain = new KeyChain();

            // Create the players wallet.
            Wallet = new Currency(0);

            G = '@';
            Name = aPlayerName;
            Location = aLocation;
            C = new Colour() { FG = ConsoleColor.Gray };
            Stats = new Stats()
            {
                Agility = 2,
                Charisma = 4,
                Endurance = 7,
                Intelligence = 7,
                Luck = 4,
                Perception = 2,
                Strength = 7,
            };

            Initialize();
        }
开发者ID:exallium,项目名称:DotNetHack,代码行数:31,代码来源:Player.cs


示例4: WhenGivenEqualValues_ReturnsTrue

            public void WhenGivenEqualValues_ReturnsTrue()
            {
                var x = new Colour(360f, 1f, 1f);
                var y = new Colour(360f, 1f, 1f);

                x.Equals(y).Should().BeTrue();
            }
开发者ID:BraveSirAndrew,项目名称:mercury-particle-engine,代码行数:7,代码来源:ColourTests.cs


示例5: DoHook

        void DoHook()
        {
            var creature = (this.ReceivedEvent as Hook).Creature;
            var colour = (this.ReceivedEvent as Hook).Colour;

            if (this.TotalRendezvous == 0)
            {
                this.TotalStoppedCreatures++;
                this.DoPostRoundProcessing();
                return;
            }

            if (this.FirstHooker == null)
            {
                this.FirstHooker = creature;
                this.FirstColour = colour;
            }
            else
            {
                this.Send(this.FirstHooker, new Hook(creature, colour));
                this.Send(creature, new Hook(this.FirstHooker, this.FirstColour));
                this.FirstHooker = null;
                this.TotalRendezvous = this.TotalRendezvous - 1;
            }
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:25,代码来源:Broker.cs


示例6: MatchColour

        private ConsoleColor MatchColour(Colour colour)
        {
            ConsoleColor matchColour;

            switch (colour)
            {
                case Colour.Red:
                    matchColour = ConsoleColor.Red;
                    break;
                case Colour.Green:
                    matchColour = ConsoleColor.Green;
                    break;
                case Colour.Blue:
                    matchColour = ConsoleColor.Blue;
                    break;
                case Colour.Yellow:
                    matchColour = ConsoleColor.Yellow;
                    break;
                case Colour.Black:
                    matchColour = ConsoleColor.Black;
                    break;
                default:
                    throw new ArgumentException("Unknown colour type.");
            }

            return matchColour;
        }
开发者ID:Anubis-Black,项目名称:TeamIodine,代码行数:27,代码来源:ConsoleRenderer.cs


示例7: Potion

 /// <summary>
 /// Creates a (base) instance of Potion/
 /// </summary>
 /// <param name="aType">The type of potion</param>
 /// <param name="aName">The name of the potion.</param>
 /// <param name="aColor">The color of the potion.</param>
 public Potion(PotionType aPotionType, PotionStrength aPotionStrength,
     string aName, Colour aColor)
     : base(ItemType.Potion, aName, '!', aColor)
 {
     PotionType = aPotionType;
     PotionStrength = aPotionStrength;
 }
开发者ID:exallium,项目名称:DotNetHack,代码行数:13,代码来源:Potion.cs


示例8: LineDeleted

        public void LineDeleted(Colour lineColour)
        {
            lineCounts.Increment(lineColour);

            Messenger<Colour, int>.Broadcast(Events.LineDeleted, lineColour, GetLineCountForColour(lineColour));
            GAHelper.LevelLineDeleted(lineColour);
        }
开发者ID:philjhale,项目名称:Rebounder,代码行数:7,代码来源:LineCountManager.cs


示例9: Armour

 public Armour(string aName, char aGlyph, Colour aColour, Location3i l,
     ArmourLocation aArmourLocation)
     : base(ItemType.Armour, aName, aGlyph, aColour, l)
 {
     ArmourLocation = aArmourLocation;
     Condition = 100;
 }
开发者ID:exallium,项目名称:DotNetHack,代码行数:7,代码来源:Armour.cs


示例10: SetColour

        private void SetColour(Colour colour)
        {
            if(sprite != null)
                sprite.SetSprite("LineInner" + colour.ToString());

            SetLayer(colour);
        }
开发者ID:philjhale,项目名称:Rebounder,代码行数:7,代码来源:LineMiddle.cs


示例11: ExaggerateColour

 private Colour ExaggerateColour(int iterations, Colour mean)
 {
     var redness = Extremise(mean.Redness, iterations);
     var greenness = Extremise(mean.Greenness, iterations);
     var blueness = Extremise(mean.Blueness, iterations);
     return new Colour(redness, greenness, blueness);
 }
开发者ID:EJLarcs,项目名称:chromesthesia,代码行数:7,代码来源:Calculate.cs


示例12: LoadFromStream

        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            GraphicsMode = (CompositionMode)stream.ReadBEUInt16();
            OpColour = new Colour(stream.ReadBEUInt16(), stream.ReadBEUInt16(), stream.ReadBEUInt16());
        }
开发者ID:heksesang,项目名称:bmff,代码行数:7,代码来源:VideoMediaHeaderBox.cs


示例13: DrawBox

 public void DrawBox(int x, int y, int height, int width, Colour colour)
 {
     DrawLine(x, y, (x + width), y, colour);
     DrawLine((x + width), y, (x + width), (y + height), colour);
     DrawLine((x + width), (y + height), x, (y + height), colour);
     DrawLine(x, (y + height), x, y, colour);
 }
开发者ID:ke2083,项目名称:KOS,代码行数:7,代码来源:Layer.cs


示例14: Plot

 public void Plot(char character, int x, int y, Layer layer, Colour colour)
 {
     var characterLines = charmap[character] as Line[];
     for (int i = 0; i < characterLines.Length; i++)
     {
         layer.DrawLine(characterLines[i].Start.X + x, characterLines[i].Start.Y + y, characterLines[i].End.X + x, characterLines[i].End.Y + y, colour);
     }
 }
开发者ID:ke2083,项目名称:KOS,代码行数:8,代码来源:Font.cs


示例15: SetButtonVisibilityForColour

        private void SetButtonVisibilityForColour(Colour colour)
        {
            if(lineCounts.GetLineCountForColour(colour) > 0)
                return;

            var button = buttons.Where(x => x.Colour == colour).Single();
            NGUITools.SetActive(button.gameObject, false);
        }
开发者ID:philjhale,项目名称:Rebounder,代码行数:8,代码来源:RemainingLinesMenu.cs


示例16: OnTargetHit

        void OnTargetHit(Colour targetColour, int hits)
        {
            //Debug.Log("Hit event! " + targetColour + "hits " + hits);

            targetHits.UpdateHits(targetColour, hits);
            if(targetHits.AllTargetsHaveHitsGreaterOrEqualTo(GOAL_TARGET_HITS))
                Messenger.Broadcast(Events.LevelComplete);
        }
开发者ID:philjhale,项目名称:Rebounder,代码行数:8,代码来源:TargetManager.cs


示例17: Actor

 /// <summary>
 /// Creates a new instance of <see cref="Actor"/> with the specified glyph
 /// and colour.
 /// </summary>
 public Actor(string aName, char aGlyph, Colour aColor, Location3i aLocation)
     : this()
 {
     Location = aLocation;
     Name = aName;
     G = aGlyph;
     C = aColor;
 }
开发者ID:exallium,项目名称:DotNetHack,代码行数:12,代码来源:Actor.cs


示例18: Weapon

 /// <summary>
 /// creates a new weapon
 /// </summary>
 /// <param name="aName">the name of the weapon</param>
 /// <param name="aGlyph">the weapon glyph</param>
 /// <param name="aColor">the weapon colour</param>
 /// <param name="l">the weapon location.</param>
 /// <param name="aWProps">weapon properties</param>
 /// <param name="aLoc">worn location</param>
 /// <param name="aSubType">weapon subtype</param>
 public Weapon(string aName, char aGlyph, Colour aColor, Location3i l,
     WeaponProperties aWProps, WeaponLocation aLoc, WeaponSubType aSubType)
     : base(ItemType.Weapon, aName, aGlyph, aColor, l)
 {
     WeaponProperties = aWProps;
     WeaponSubType = aSubType;
     WeaponLocation = aLoc;
 }
开发者ID:exallium,项目名称:DotNetHack,代码行数:18,代码来源:Weapon.cs


示例19: WhenGivenEqualColour_ReturnsTrue

            public void WhenGivenEqualColour_ReturnsTrue()
            {
                var x = new Colour(360f, 1f, 1f);

                Object y = new Colour(360f, 1f, 1f);

                x.Equals(y).Should().BeTrue();
            }
开发者ID:BraveSirAndrew,项目名称:mercury-particle-engine,代码行数:8,代码来源:ColourTests.cs


示例20: WhenGivenValues_ReturnsInitializedColour

            public void WhenGivenValues_ReturnsInitializedColour()
            {
                var colour = new Colour(1f, 1f, 1f);

                colour.H.Should<float>().Be(1f);
                colour.S.Should<float>().Be(1f);
                colour.L.Should<float>().Be(1f);
            }
开发者ID:BraveSirAndrew,项目名称:mercury-particle-engine,代码行数:8,代码来源:ColourTests.cs



注:本文中的Colour类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ColourValue类代码示例发布时间:2022-05-24
下一篇:
C# Colors类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap