JohnnyOpcode / degrafa

Automatically exported from code.google.com/p/degrafa
1 stars 0 forks source link

PaletteUtils.getHSBPalette() not returning a proper array #73

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. execute PaletteUtils.getHSBPalette(100,100,100);
2. array returned has length of 200 (100 undefined elements, 100 colors)
3. array of colors does not contain the desired range of hues

What is the expected output? What do you see instead?

Expect array of 100 elements, expect elements to be a 360 degree range of hues.

Two minor fixes in getHSBPalette:

public static function getHSBPalette(size:int, s:Number, b:Number):Array{
    //var colorMap:Array = new Array(size);
    var colorMap:Array = new Array();
    var h:Number;
    for (var i:int=0; i<size; i++ ) {
        h = (i)/(size-1);
        //colorMap.push(hsb(h,s,b));
        colorMap.push(hsb(h*360,s,b));
    }
    return colorMap;
}

What version of the product are you using? On what operating system?

Degrafa Beta 3

Please provide any additional information below.

Original issue reported on code.google.com by sunilbd...@gmail.com on 12 Jan 2009 at 8:47