> For the complete documentation index, see [llms.txt](https://vrs-guidebook-2nd-edition.gitbook.io/vrs-guidebook-2nd-edition/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vrs-guidebook-2nd-edition.gitbook.io/vrs-guidebook-2nd-edition/programming/blocks/utilities/color.md).

# Color

Color plays an important role in FTC. It is often used to recognize and track objects,  follow a line. The blocks in this section allow you to get information from objects and convert into different color models.

**call Color.rgbToHue**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeQJpsaxyAtOXbvQaYq393eICDzYb6xs2DYDxAegg_DldWuV6fF9vF1R-U21psI0pXE-bYwNxFZ5bjUYrpBpZeM3j_HCinGWRbk92g8DJeHvaM8ySUanH-nX9uKpvdqIegrdJwkDpsTgZumyXk6JNYBjMUS?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the hue component of the color with the given red, green, and blue values.

**call Color.rgbToSaturation**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdEt_E9s3awwARLiSIGdfLnSwF4zt6PdBoFzN9bCKE5Ji-LHaPKhIhMQ0-F9VbPAR2BIfFsVT0uKiCbSF9Zd7_GAgmzc5tDKrf2QABCFvJJlIB8hbmP80t0dKyt-pGmmAX2NMQrXSHDWfC4g3g0hqA1-S4z?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the saturation component of the color with the given red, green, and blue values.

**call Color.rgbToValue**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeKKWGuCUzFBjN7zEN2rR6Tvvnd9HCfzXY34eiTIctSO0OA4OkAnILgPc8-Aj_L9j9dFZg06aUAQQk_AeKHw98kp9NhhaGeyl1iHPUjNkhzJWPciOtw1W-x8nCHwnEjoUDsvz6KIUXbOZNk1VpvqnjZc3Ng?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns a single value for the color with the given red, green, and blue values.

**call Color.rgbToText**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcMfNQN87OAMkFIkQRPZEo8FPYzSRB9TwroqRq7pMxhUhEBQ-4Zv5uKuemWRBH5KOhZnl2-Gv_t9BkyeP_FBrTO6k-EBcgbS6h2Yd0dNGVCav94P2p26jyT863tet6dyQO9sIA4mPFZfDNmnORcRu1bd6bY?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the color in text format “#AARRGGBB” or “#RRGGBB”.

**call Color.showColor**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdhq0CTu4rb1RIl4ktkxgKnkbn05vNW1nnEciBYn-c7YQKFm15_jnMvc6jG47_GDc5BjfWMgK1CqfFPhftuAuA64J2BUkraxaHBzbYg5sWaD9BcSUKNc_RRg40_0JFznRCto2PUE_oiblkUuabFq61HmiQ?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Shows the color on the Robot Controller screen.

**Color.Red**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcctlvas0KqijuvHSpI77eNDipyzDW7L-klc1tucHbYW_vlpzudeih2FJe51GkHeqO-mRRC0x-5kYe3tf9UlL6TELQ14YiHYc_BRL0Ib4nF0Y4YnyneMg8AVPRZKSHxEe7i6zBUlmKHUlQdzdEX-IDaJgQ?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the red component of the given color object. The returned value ranges from 0 to 255.&#x20;

**Color.Green**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXflmeVYbB5jRhgMC8hStxNRua-rKVbtUSV1UgrtZePDH-Wlpd4_2rXaSZt4x1_NoPyKRoBasGya7HIYGUYzPraNMi2PgpZgDFPCjTfM10YPMVhUfn5Z7tsifCI1xmyFOAiiGrjTZc_thhgitctQnIKJaA4?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the green component of the given color object. The returned value ranges from 0 to 255.&#x20;

**Color.Blue**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfF2xCKueOM-FKNeFlkrMgUWChgelqjHE8bgk8E0WaFA0Dc8OL7fq6tG2HQ6KIhzyhHro1xgqwtJi12Hw5po_bl-fwenUcy9IdaLSMJ63FMmUUpn9zcdnVTU8PuGeT5Bdq7iT-ni5Js8Zrqf8Wi9bp1AW2B?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the blue component of the given color object. The returned value ranges from 0 to 255.&#x20;

**Color.Alpha**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXejYsiavEG1YrqDjMFnn1cAi-gNXlYhWONVukVP-ekA1_bzuIgt8phDLUoSi6dCggz7cF_GM3kKk-PUDeGGFtm4VylL6gh7Pa_7Wtwlq4eQbiiFKOpN7axg7B9ptki5scF3CsQrML0fo0zgr3jZRk2hJCeW?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the alpha component of the given color object. The returned value ranges from 0 to 255.

**Color.Hue**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd_ZtKgjQ4jA_ro3sA4QCL7NkkgJ41oIGb4aK_9e05ByHMjFSWoOSDImJDr0bEqm-AU1xr_FyDFBDjQBSM0Q4MqXbKpZNHoBPypmdFXbG-hQ0Eohy0d1VROc3kthrzF0PIT0h9ZkRYoKC1WvEdm-fMm5gHq?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the hue component of the given color object. The returned value ranges from 0 to 255.&#x20;

**Color.Saturation**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdHrOQK5XZeVz7RYtMA9kN9l6n81zhbDOEUhHE6NCnfkp_s0rPSfjsxoyRyFaJt5rlOvWMJa3Q7aVTbt1oH5p6pOdMo5j1mIr35p7ly2TmEV_3_byDwhnR1UwqJiLOBDAUoIV1UxOCdvugF9dwrzPNxsXw?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the saturation component of the given color object. The returned value ranges from 0 to 255.

**Color.Value**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcXbMFXhjj3smaQS_DzlfldqIRLmtD-zciW_Yboh6yIczJoSuI8Dz6LqeElBNUwBnq-Vvo2-jdGBEu4zct4eSu7BQRkth6TwzSDmFOfEzPma-D0wtbpZeYlgU5RMhcGLGsQJ9dgwpWYPPOtcTBbPEiSeCE1?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the value of the given color object. The returned value is a 32-bit integer value that represents a color using the ARGB (Alpha, Red, Green, Blue) color model. Each of the four components (A, R, G, B) is allocated 8 bits, resulting in a total of 32 bits.

**call Color.rgbToColor**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfrKa5e0zAhRvPYobbu73hcGIgjFRJGqzOcrblm_rgSYvGvGkE3Zx8uG1LFdnsMDjEnZP9AI6h-z64WcHmf7NKP-FUAFNPExJnN35QnFC1Ym9qOH18gN7AAtj2r4vRyoXvPWyyelj6gDuYc0_pv5HXsbnKr?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns a new color object using the given values for red, green, and blue.

**call Color.argbToColor**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc6jaqQyZ2a_R5yoUhGfjBdnNy66ylRWgT1NjzMGAJE2l2c7Vj6FXT9wBSey5y9OcOQNhVNpF0AsOEIwMGSUesKWoge-ELMtUEZwjRtqaxld1QFRq42ykJ0FXt3XnU-rCnLFR14XwE0OLdPF-ZdiXFqlbOK?key=hRw9bBhBfp1lHBJ7rUAI2Q)

&#x20;Returns a new color object using the given values of alpha, red, green, and blue.

**call Color.hsvToColor**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcN-S3_tFyRYSEN6dn-qTx7rimIBcA2eJI_Jt8CyHIvb48G-QZ95aHfmGl2VRjFflkt2DHZ2QX7ZlsvZwbRSGluGqRSreHwnhlVjWmoALi7dY2ArqeEmafJOjswK1rjEFCeBqqBgyUfhnseyK6C6A0dUDy8?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns a new color object using the given values of alpha, hue, saturation, and value.

**call Color.hsvToColor**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdCNPh3gh8RW4hoayniuAXs6OhfS3cNQov1oF0XLF0qjs4KtiObdGpEiw_ezV21BkgCFheOyEJYrlbjVpK_kMpyyRLl9od9V09tDDrfMJ0kSiJXBhnUI0HEzs7Hg_mVgjo27aR5TswTFP6I04uyecMSjS7U?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns a new color object using the given values of hue, saturation, and value

**call Color.textToColor**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc4-5MbeJVwlivC5HMRV9Db88SXhhB6YVR9pqgE0JOhzcW_YFfUo5kpFyF2BwraqJWLoRPMKI1jp-YpmyZaONiVwE9phHv_M3JzjElhAfOX_rNJ_RLk3kCH087qyS-RUBSRLNm-1KdvnQ_fznc6TtYCmAok?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns a new color object using the given text value assuming it has the format of “#RRGGBB” or “#AARRGGBB”.

**NormalizedColors.Red**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcrJ0FLnrXOWxWwIYogDy0-h_jPFM2C1tzpnpNp8ck_LMkzgAAWh4Y6Vlt08rewDGaHZJ1p0L2XPAZ63OYZJIYOItcs_3rDN1BNT0afvd0FrmLgup7KSBe3BqM08oH4PW_MDqjKu2aQrNMyDvtQ-s_6NDkh?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the red value of the given normalized Color object. The value ranges from 0 to 1.

**NormalizedColors.Green**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXevpN0AVEEpiATFkAMrvKToTaTLEHnEGxFS9LgUkW450lJ1sDxXvD9fjUKrciQKNbg5g8rnDYs6dEHWAReozfIFJVl6IeJcBBeJgMyiK4nVLkj8FvkXQXuF0J4ViQbPFhAu2MfwymKXrjpA4q9tVXjG3LM?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the green value of the given normalized Color object. The value ranges from 0 to 1.

**NormalizedColors.Blue**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfONnV7kMu7zkUxj-3cbhACkFrUqoKrkzioerQpcx8CNK8i8uirGZGermk6imkcyCVDwJm_qlNErs2KidEE6IZXRLIEKjKGOE6EfdKUuSWr3vAytvvzI7b0PFS7hxRijaHC-UXH--aGiUf3hfmgzKvyB9Ab?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the blue value of the given normalized Color object. The value ranges from 0 to 1.

**NormalizedColors.Alpha**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcdYIfhABSAgxzNIYBwwHpsAkS88vd6UtGjx8-M3C8u91L2anN2HClLWRpzzFOIJpj3ITlQD8NOt8c-W66c_LS-jhHeReha6blrF78vkU4RDgRum3ShPkQbRkoy3GlNuCQsMJB_aJtWexdrt4KYsOlPHSg?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the alpha value of the given normalized Color object. The value ranges from 0 to 1.

**NormalizedColors.Color**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeJfmEyUXirT__v2gICluvCIwBHwE09wimnDvCOD8NpDnZu38GV29uKLYyGguaVVnqSVpH2C_8nscP7FW1YgZF4Z6XEK4--l_cNiQnxuHP5LlZ2IXzq7cYbv66s-GaAsiccEsOGe4kvJJdMKQCfPWhtidYb?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Returns the Android color integer representation of the normalized color. The returned value is a 32-bit integer value that represents a color using the ARGB (Alpha, Red, Green, Blue) color model. Each of the four components (A, R, G, B) is allocated 8 bits, resulting in a total of 32 bits.
