Print Color with integers

Report a typo

Write the code for the function printColorInt(). It reads 3 floats Red, Green, and Blue from stdin (separated by a space). These floats denote the 3 float color components of a Color instance. If any of these values is outside the range 0 to 1, then print Invalid input. Otherwise, create a Color instance and print the 3 color components as integers (separated by a space).

Sample Input 1:

1.0 0.0 1.0

Sample Output 1:

255 0 255
Write a program in Kotlin
fun printColorInt() {
// Write your code here

//
}
___

Create a free account to access the full topic