title: How do you define a customisable RGB background colour in java?
body: <p>I am new to java and I have searched for an answer on Google for a while now, but I cannot find a way to get an RGB background colour, I can only find how to set a background colour from the main colours already provided by java(for example, "Color.BLACK"). I am using a JFrame. Please help. Thanks. In this is my background code.</p>
  
  <pre><code>    public void paintComponent(Graphics g){
          super.paintComponent(g);
  
          this.setBackground(Color.PINK); //My current background colour code but I am looking to use a customisable RGB one.
  
          g.setColor(Color.BLACK);
          g.fillRect(0, 0, 40, y);
  
          tm.start();
      }
  </code></pre>