当前位置: 首页>>代码示例>>C#>>正文


C# ColorType类代码示例

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


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

示例1: GetBytes

 public static byte[] GetBytes(Color color, ColorType type)
 {
     switch (type)
     {
         case ColorType.ARGB8888_32:
             return ByteConverter.GetBytes(color.ToArgb());
         case ColorType.XRGB8888_32:
             color = Color.FromArgb(0, color);
             goto case ColorType.ARGB8888_32;
         case ColorType.ARGB8888_16:
         {
             byte[] result = new byte[4];
             int i = color.ToArgb();
             ByteConverter.GetBytes((ushort)(i & 0xFFFF)).CopyTo(result, 0);
             ByteConverter.GetBytes((ushort)((i >> 16) & 0xFFFF)).CopyTo(result, 2);
             return result;
         }
         case ColorType.XRGB8888_16:
             color = Color.FromArgb(0, color);
             goto case ColorType.ARGB8888_16;
         case ColorType.ARGB4444:
             return ByteConverter.GetBytes((ushort)(((color.A >> 4) << 12) | ((color.R >> 4) << 8) | ((color.G >> 4) << 4) | (color.B >> 4)));
         case ColorType.RGB565:
             return ByteConverter.GetBytes((ushort)(((color.R >> 3) << 11) | ((color.G >> 2) << 5) | (color.B >> 3)));
     }
     throw new ArgumentOutOfRangeException("type");
 }
开发者ID:Radfordhound,项目名称:sa_tools,代码行数:27,代码来源:VColor.cs

示例2: FlipTurn

 private void FlipTurn()
 {
     if (turn == ColorType.WHITE)
         turn = ColorType.BLACK;
     else
         turn = ColorType.WHITE;
 }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:7,代码来源:ChessGamePlayer.cs

示例3: OnTriggerEnter2D

    public void OnTriggerEnter2D(Collider2D collision)
    {
        if(collision.transform.CompareTag("Player"))
        {
            DestoryEvent();
            GameLogic.Instance.Hit(20);
        }
        if (collision.transform.CompareTag("Bullet"))
        {
            if (ColorManager.Instance.IsColorCollision(collision.GetComponent<Bullet>().myColor,enemyColor))
            {
                ColorType temp;
                temp = ColorManager.Instance.CheckMixColor(enemyColor,collision.GetComponent<Bullet>().myColor);
                GameLogic.Instance.AddScore(10);
                Debug.Log(temp);
                if (temp == enemyColor)
                {
                    DestoryEvent();
                }
                else
                {
                    enemyColor = temp;
                    ChangeColor(enemyColor);
                }
                
            }
            else
                GameLogic.Instance.Hit(10);


        }
    }
开发者ID:Youngchangoon,项目名称:ColorCannon,代码行数:32,代码来源:Enemy.cs

示例4: NumberSprite

 // if numDigits = 0, don't care how much space it takes up
 private NumberSprite(ContentManager Content, int number, int numDigits, ColorType color, OperatorType op)
 {
     this.Content = Content;
     this.number = number;
     this.numDigits = numDigits;
     this.color = color;
     this.op = op;
 }
开发者ID:coler706,项目名称:CaveStory,代码行数:9,代码来源:NumberSprite.cs

示例5: TextDecoration

 private TextDecoration(ColorType ctbg, Color bg, ColorType cttxt, Color txt, bool underline, bool bold) {
     _bgColor = bg;
     _bgColorType = ctbg;
     _textColor = txt;
     _textColorType = cttxt;
     _underline = underline;
     _bold = bold;
 }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:8,代码来源:TextDecoration.cs

示例6: SetColorPalette

 public static void SetColorPalette(Entity entity, ColorType color)
 {
     if (entity.HasComponent<Sprite>())
     {
         ColorTypeAttribute attr = color.GetAttributeOfType<ColorTypeAttribute>();
         entity.GetComponent<Sprite>().SetColorOverride(attr.Red, attr.Green, attr.Blue, attr.Alpha);
     }
 }
开发者ID:zunath,项目名称:MMXEngine,代码行数:8,代码来源:SpriteMethods.cs

示例7: ColorComboBox

 public ColorComboBox()
 {
   SetComboBoxProperties(this);
   _contextStrip = new ContextMenuStrip();
   FillMenu();
   this.ContextMenuStrip = _contextStrip;
   _colorType = ColorType.KnownAndSystemColor;
 }
开发者ID:Altaxo,项目名称:Altaxo,代码行数:8,代码来源:ColorComboBox.cs

示例8: PngHeader

 /// <summary>
 /// Creates a new instance of PngHeader
 /// </summary>
 public PngHeader(int width, int height)
 {
     _width = width;
     _height = height;
     _bitdepth = BitDepth.Eight;
     _colortype = ColorType.TruecolorAlpha;
     _interlaceMethod = InterlaceMethod.NoInterlacing;
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:11,代码来源:PngHeader.cs

示例9: Field

 /// <summary>
 /// Field constructor that takes an IPosition object as argument
 /// </summary>
 /// <param name="position">The position for the current IField object</param>
 /// <param name="color">The color for the current IField object</param>
 /// <param name="chessBoard">The chess board for the current IField object</param>
 protected Field(IPosition position, ColorType color, IChessBoard chessBoard)
 {
     this.ChessBoard = chessBoard;
     this.Position = position;
     this.Color = color;
     this.HasChessPiece = false;
     this.IsDrawable = true;
 }
开发者ID:BadassGamingCrew,项目名称:Chess-Might-and-Magic,代码行数:14,代码来源:Field.cs

示例10: ToIndex

		static int ToIndex(ColorType colorType) {
			if (ColorType.FirstNR <= colorType && colorType < ColorType.LastNR)
				return (int)(colorType - ColorType.FirstNR);
			if (ColorType.FirstUI <= colorType && colorType < ColorType.LastUI)
				return (int)(colorType - ColorType.FirstUI + ColorType.LastNR - ColorType.FirstNR);
			Debug.Fail(string.Format("Invalid color: {0}", colorType));
			return 0;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:Theme.cs

示例11: Rook

            public Rook(ColorType color, int rank, int file,
				     ChessSide myside,
				     ChessSide oppside)
                : base(PieceType.ROOK,
							      color, rank,
							      file, myside,
							      oppside)
            {
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:9,代码来源:Rook.cs

示例12: Pawn

            public Pawn(ColorType color, int rank, int file,
				     ChessSide myside,
				     ChessSide oppside)
                : base(PieceType.PAWN,
							      color, rank,
							      file, myside,
							      oppside)
            {
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:9,代码来源:Pawn.cs

示例13: Block

 public Block(int x1, int y1, int x2, int y2, ColorType color)
 {
     this.x1 = x1;
     this.x2 = x2;
     this.y1 = y1;
     this.y2 = y2;
     this.color = color;
     this.ID = null;
 }
开发者ID:marce155,项目名称:Tetris-Csharp,代码行数:9,代码来源:Block.cs

示例14: Coloration

 //    : this(colorType, pallet.ToList())
 //{
 //}
 //public Coloration(ColorType colorType, IEnumerable<Color> pallet)
 public Coloration(ColorType colorType, params Color[] pallet)
 {
     if (pallet == null || pallet.Length == 0)
     {
         throw new InvalidOperationException("The pallet cannot be empty.");
     }
     this._ColorType = colorType;
     this.SetSourcePallet(pallet);
 }
开发者ID:alexsharoff,项目名称:wpf-office-theme,代码行数:13,代码来源:Coloration.cs

示例15: King

            public King(ColorType color, int rank, int file,
				     ChessSide myside,
				     ChessSide oppside)
                : base(PieceType.KING,
							      color, rank,
							      file, myside,
							      oppside)
            {
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:9,代码来源:King.cs


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