private void SetUI() { if (ColorSystem.Detailed) { rgbText.text = "(" + color.r + " ," + color.g + ", " + color.b + ")"; colorText.text = ColorIdentifier.ColorPrimary(color); hueText.text = ColorIdentifier.ColorHue(color); } image.color = color; }
private void DrawNextColor() { print("Draw next"); Color32 color = colors.State.GetColor(0); generator.GenerateBlock(color); colorImage.color = color; colorRGB.text = Colors.ColorToRGB(color); colorName.text = ColorIdentifier.ColorPrimary(color); colorHue.text = ColorIdentifier.ColorHue(color); }
public void GenerateBlock(Color32 color) { if (!generate) { return; } if (color.r != 0 && color.r != 255) { return; } if (color.g != 0 && color.g != 255) { return; } if (color.b != 0 && color.b != 255) { return; } GameObject newBlock = Instantiate(blockPrefab); newBlock.transform.parent = blockParent; newBlock.name = "(" + color.r + ", " + color.g + ", " + color.b + ") " + ColorIdentifier.ColorHue(color); newBlock.transform.GetChild(0).GetComponent <MeshRenderer>().material.color = color; newBlock.transform.localScale *= scale; newBlock.transform.position = new Vector3(color.r * scale, color.g * scale, color.b * scale); }