Java tutorial
//package com.java2s; import java.util.ArrayList; import android.graphics.PointF; public class Main { private static ArrayList<PointF> colorPointsForModel(String model) { // LLC001, // LedStrip // LWB001, // LivingWhite if (model == null) { // if model is not known go for the default choice model = " "; } ArrayList<PointF> colorPoints = new ArrayList<PointF>(); ArrayList<String> hueBulbs = new ArrayList<String>(); hueBulbs.add("LCT001"); ArrayList<String> livingColors = new ArrayList<String>(); livingColors.add("LLC001"); livingColors.add("LLC005"); livingColors.add("LLC006"); livingColors.add("LLC007"); livingColors.add("LLC010"); livingColors.add("LLC011"); livingColors.add("LLC012"); if (hueBulbs.contains(model)) { // Hue bulbs color gamut triangle colorPoints.add(new PointF(.674F, 0.322F)); // Red colorPoints.add(new PointF(0.408F, 0.517F)); // Green colorPoints.add(new PointF(0.168F, 0.041F)); // Blue } else if (livingColors.contains(model)) { // LivingColors color gamut triangle colorPoints.add(new PointF(0.703F, 0.296F)); // Red colorPoints.add(new PointF(0.214F, 0.709F)); // Green colorPoints.add(new PointF(0.139F, 0.081F)); // Blue } else { // Default construct triangle wich contains all values colorPoints.add(new PointF(1.0F, 0.0F));// Red colorPoints.add(new PointF(0.0F, 1.0F)); // Green colorPoints.add(new PointF(0.0F, 0.0F));// Blue } return colorPoints; } }