Here you can find the source of length(float[] color)
public static double length(float[] color)
//package com.java2s; /******************************************************************************* * Copyright (c) 2015 Christian Hensel/*from ww w .j av a 2s . c om*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Christian Hensel - initial API and implementation *******************************************************************************/ public class Main { /** * Length of a vector. */ public static double length(float[] color) { return Math.sqrt(color[0] * color[0] + color[1] * color[1] + color[2] * color[2]); } }