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


C# Color.ToString方法代码示例

本文整理汇总了C#中Color.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Color.ToString方法的具体用法?C# Color.ToString怎么用?C# Color.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Color的用法示例。


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

示例1: SetMapNameSimple

	public void SetMapNameSimple( string _strName, Color _color)
	{
		m_strMapName = _strName;
		m_TempColor = _color;

		mapName.Text = m_TempColor.ToString() + _strName;
		RsetSize();
	}
开发者ID:ftcaicai,项目名称:ArkClient,代码行数:8,代码来源:UIZoneImg.cs

示例2: FromColor

        public static string FromColor(Color color)
        {
            KeyValuePair<string, Color> pair = _colorMap.FirstOrDefault(a => a.Value == color);

            if (pair.Value == null)
                throw new Exception("Cannot find BackColorname for: " + color.ToString());

            return pair.Key;
        }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:9,代码来源:ColorConversion.cs

示例3: CreateTileSprite

    // TODO this method probably belongs somewhere else
    public static Sprite CreateTileSprite(Color color, int size)
    {
        var texture = new Texture2D(size, size);
        var colors = Enumerable.Repeat<Color>(color, size * size).ToArray();
        texture.SetPixels(0, 0, size, size, colors);

        var sprite = Sprite.Create(texture, new Rect(0f, 0f, texture.width, texture.height), Vector2.zero);
        sprite.name = color.ToString();
        return sprite;
    }
开发者ID:ntl92bk,项目名称:UnityTileMap,代码行数:11,代码来源:TilePainter.cs

示例4: GenerateEvent

 //generates and enables a point event
 static void GenerateEvent()
 {
     //	current_color = colors[0];
     current_color = colors[Random.Range(0,colors.Length)];
     current_dur = durations[Random.Range(0,durations.Length)];
     current_mul = multipliers[Random.Range(0,multipliers.Length)];
     event_on = true;
     last_event_generated = Time.time;
     Debug.Log("new event generated: "+current_color.ToString()+" "+current_dur+" "+current_mul);
 }
开发者ID:mbc1990,项目名称:Orb,代码行数:11,代码来源:Event_Generator.cs

示例5: parse

        public override void parse(string curLine)
        {
            TextParser tp = new TextParser();
            actionType = ActionType.Fade;

            color = ColorUtils.colorFromHexString(curLine.Substring(6, 6));
            color.A = 0;
            time = int.Parse(tp.seperateWords(curLine)[2]);
            Console.WriteLine("Parsed a fade! Color " + color.ToString());
            elapsed = 0;
        }
开发者ID:TheMightyComp,项目名称:LibCSL,代码行数:11,代码来源:FadeAction.cs

示例6: FormatColourString

 public static string FormatColourString(Color colour, ColourRepresentations format)
 {
     switch (format)
     {
         case ColourRepresentations.RGB:
             return colour.R.ToString() + "," + colour.G.ToString() + "," + colour.B.ToString();
         case ColourRepresentations.Hex:
             return "#" + colour.ToArgb().ToString("X6");
         default:
             return colour.ToString();
     }
 }
开发者ID:tdwright,项目名称:ColourPickerComponents,代码行数:12,代码来源:ColourHandler.cs

示例7: SpriteLayer

        public SpriteLayer(string mat, Color c)
        {
            MatName = mat;
            LayerColor = c;

            Material baseMat = Resources.Load(mat) as Material;
            if (baseMat == null)
            {
                Debug.Log("Unable to load material " + mat);
                return;
            }

            LayerMaterial = new Material(baseMat);

            LayerImage = LayerMaterial.mainTexture;
            LayerMaterial.name += c.ToString();
            LayerMaterial.color = c;
        }
开发者ID:JeffM2501,项目名称:CSC370,代码行数:18,代码来源:SpriteManager.cs

示例8: Button_PicColor

    public void Button_PicColor(UnityEngine.UI.Button f_button)
    {
        Debug.Log("Picking Color");
        UnityEngine.UI.ColorBlock cb = f_button.colors;
        playerColor = cb.normalColor;
        Debug.Log("Picked: " + cb.normalColor.ToString());

        cb = colorButton.colors;
        cb.normalColor = playerColor;
        cb.pressedColor = playerColor;
        cb.highlightedColor = playerColor;
        Debug.Log("New Player Color: "+playerColor.ToString());
        colorButton.colors = cb;

        colorButton.gameObject.SetActive(true);
        colorPickerPanel.gameObject.SetActive(false);
        SettingsController.GetInstance().playerFile.Color = playerColor;
    }
开发者ID:simonides,项目名称:space_concept,代码行数:18,代码来源:StartMenuController.cs

示例9: Create

        public static Texture2D Create(GraphicsDevice graphicsDevice, int width, int height, Color color)
        {
            string key = color.ToString () + width + "x" + height;
            if (textureCache.ContainsKey (key)) {
                return textureCache [key];
            }
            else {
                // create a texture with the specified size
                Texture2D texture = new Texture2D (graphicsDevice, width, height);

                // fill it with the specified colors
                Color[] colors = new Color[width * height];
                for (int i = 0; i < colors.Length; i++) {
                    colors [i] = new Color (color.ToVector3 ());
                }
                texture.SetData (colors);
                textureCache [key] = texture;
                return texture;
            }
        }
开发者ID:knot3,项目名称:knot3-prototype,代码行数:20,代码来源:TextureHelper.cs

示例10: changeColor

 void changeColor(GameObject brick)
 {
     //Color color = brick.transform.renderer.material.color;
     SpriteRenderer sr = GetComponent<SpriteRenderer>();
     Color color = sr.color;
     Color ORANGE = new Color(0.934f, 0.409f, 0.124f, 1.00f);
     Color GOLD = new Color(1.000f, 0.929f, 0.037f, 1.000f);
     Color BLUE = new Color(0.026f, 0.396f, 0.893f, 1.000f);
     if (color.ToString().Equals(ORANGE.ToString()))
     {
         sr.color = GOLD;
     }
     else if (color.ToString().Equals(GOLD.ToString()))
     {
         sr.color = BLUE;
     }
     else if (color.ToString().Equals(BLUE.ToString()))
     {
         sr.color = new Color(1f, 1f, 1f, 1f);
     }
 }
开发者ID:Xociety,项目名称:Retro-,代码行数:21,代码来源:BrickCollision.cs

示例11: Combine

        public static Color Combine(this Color color, Color otherColor)
        {
            // primary combinations
            if ((color == Red && otherColor == Blue) || (color == Blue && otherColor == Red))
                return Purple;
            if ((color == Blue && otherColor == Yellow) || (color == Yellow && otherColor == Blue))
                return Green;
            if ((color == Red && otherColor == Yellow) || (color == Yellow && otherColor == Red))
                return Orange;

            // redundant color combinations
            if (color.Contains(otherColor))
                return color;
            if (otherColor.Contains(color))
                return otherColor;

            #if DEBUG
            Console.WriteLine(String.Format("Possibly unsupported color combination: {0} and {1}", color.ToString(), otherColor.ToString()));
            #endif
            return Black;
        }
开发者ID:akbiggs,项目名称:Trauma,代码行数:21,代码来源:ColorHelper.cs

示例12: Initialise

	public void Initialise(int _maxPoints, float _width, Color _colour, string speciesName) {
		maxPoints = _maxPoints;
		width = _width;
		colour = _colour;
		name = speciesName + " " + colour.ToString();
	}
开发者ID:jxz12,项目名称:ecosystems_game,代码行数:6,代码来源:Graph.cs

示例13: CheckGetQuestItem

	public void CheckGetQuestItem(int iItemID)
	{
		Item nowItem = ItemMgr.ItemManagement.GetItem(iItemID);

		if (nowItem.ItemData.GetItemType() != Item.eITEM_TYPE.UseItem)
			return;

		if (nowItem.ItemData.GetSubType() != (int)Item.eUSE_ITEM.GetQuest)
			return;

		Color textColor = new Color(1.0f, 0.717f, 0.0627f, 1.0f);

		System.Text.StringBuilder sb = new System.Text.StringBuilder(textColor.ToString());
		sb.Append(AsTableManager.Instance.GetTbl_String(2134));

		ArkQuestmanager.instance.ShowBalloonRewardMsgBox(sb.ToString(), AsTableManager.Instance.GetTbl_String(2134), 10.0f);
	}
开发者ID:ftcaicai,项目名称:ArkClient,代码行数:17,代码来源:Inventory.cs

示例14: SetActiveColor

    public void SetActiveColor(string color)
    {
        Color activeColor = new Color();
        switch (color)
        {
        case "red":
            activeColor = Color.red;
            break;
        case "blue":
            activeColor = Color.blue;
            break;
        case "yellow":
            activeColor = Color.yellow;
            break;
        case "green":
            activeColor = Color.green;
            break;
        case "black":
            activeColor = Color.black;
            break;
        default:
            activeColor = Color.black;
            break;
        }

        AccessCamera.SendMessage("setColor", activeColor.ToString());
    }
开发者ID:rinkenuyten,项目名称:ExpoDraw,代码行数:27,代码来源:UIScript.cs

示例15: OnSetColor

	public void OnSetColor(Color color)
	{
		Debug.Log ("on set color, " + color.ToString ());

		foreach (int id in _selectedMaterials) {
			_materialColors[id] = color;
			_materialsDict[id].GetComponent<MaterialLineController>().SetColor (color);

			// TODO refresh mesh color
			_demo.RefreshMesh();
		}
		
	}
开发者ID:whztt07,项目名称:PolyWorldEditor,代码行数:13,代码来源:MaterialsController.cs


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