Write the code for the function printColorFloat(). It reads 3 integers Red, Green, and Blue from stdin (separated by a space). These integers denote the 3 color components of a Color instance. If any of these values is outside the range 0 to 255, then print Invalid input. Otherwise, create a Color instance and print the 3 color components as floats (separated by a space).
Image blending
Print Color with floats
Report a typo
Sample Input 1:
0 255 0Sample Output 1:
0.0 1.0 0.0Write a program in Kotlin
import java.awt.Color
fun printColorFloat() {
// Write your code here
//
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.