Here you can find the source of toFloat(Object rawColor)
private static float toFloat(Object rawColor)
//package com.java2s; public class Main { private static float toFloat(Object rawColor) { return rawColor instanceof Integer ? (float) (Integer) rawColor : (float) (double) rawColor; }/*from w w w .j av a2 s . c o m*/ }