Introduction
When we start creating art or graphics on a computer, the most basic thing that we do is draw and add color. Well, you can draw anything you want but coloring is the most fun part! Isn’t it!? Well to color your creation, we hereby introduce you to the Java FX colorinput class, which can easily help you color any of your creations. Before going further, let’s know a little about JavaFX.
JavaFX is a Java library for creating rich client applications. It provides an API for creating graphical user interface (GUI) applications that can run on almost any device that supports Java.
This blog will discuss the ColorInput class present in the JavaFX framework. We will also examine the types of constructors and methods present in the ColorInput class. Along with its implementation, so let’s get started.
ColorInput Class
JavaFX includes the ColorInput class. The ColorInput class is used in the JavaFX application to apply various color input effects. It can fill the specified shape with a given color input effect. The javafx.scene.effect package contains all of the methods required for this purpose.
It's used to make an effect that draws a rectangular region filled with the specified color. It's the same as rendering a filled rectangle into an image and applying an ImageInput effect, except it's much more convenient and potentially much more efficient. It is primarily used as an input to the other effects.
Now we’ll discuss the different constructors present in this class using which we can initiate the class.
Constructors
There are two different types of constructors available in the colorinput class:
- ColorInput(): Creates a new ColorInput instance with the default parameters.
- ColorInput(double x, double y, double width, double height, Paint paint): Creates a new ColorInput instance with the specified x, y, width, height, and paint.
Properties and their Corresponding Setter Methods
Javafx.scene.effect.ColorInput class properties and their setter methods are described in the table below.





