Create smooth gradient with HSB in java

I’m trying to create a sorting algorithm visualiser in greenfoot java, with an array shown as a column graph. I want it to be colourful, so I’m using a colour gradient like shown in this video https://…

Is it possible to use Color Hex in JLabel like #02f7fc?

Is it possible to use Color hex in JLabel such as #02f7fc? I want to use A-F colors. Using label.setForeground(Color.(BLUE/RED/BLACK/…); is so boring.