Package toxi.util.datatypes

Examples of toxi.util.datatypes.FloatRange


     */
    public ColorRange(FloatRange hue, FloatRange sat, FloatRange bri,
            FloatRange alpha, FloatRange black, FloatRange white, String name) {
        super();
        hueConstraint = new GenericSet<FloatRange>(hue != null ? hue
                : new FloatRange(0, 1));
        saturationConstraint = new GenericSet<FloatRange>(sat != null ? sat
                : new FloatRange(0, 1));
        brightnessConstraint = new GenericSet<FloatRange>(bri != null ? bri
                : new FloatRange(0, 1));
        alphaConstraint = new GenericSet<FloatRange>(alpha != null ? alpha
                : new FloatRange(1, 1));
        if (black == null) {
            this.black = new FloatRange(0, 0);
        } else {
            this.black = black;
        }
        if (white == null) {
            this.white = new FloatRange(1, 1);
        } else {
            this.white = white;
        }
        this.name = name != null ? name : "untitled" + (UNTITLED_ID++);
    }
View Full Code Here


     *
     * @param hue
     *            base hue
     */
    public ColorRange(Hue hue) {
        this(new FloatRange(hue.getHue(), hue.getHue()), null, null, null,
                null, null, null);
    }
View Full Code Here

     *
     * @param c
     *            base color
     */
    public ColorRange(ReadonlyTColor c) {
        this(new FloatRange(c.hue(), c.hue()), null, null, null, null, null,
                null);
    }
View Full Code Here

     * @param c
     *            color to use as constraint
     * @return itself
     */
    public ColorRange add(ReadonlyTColor c) {
        hueConstraint.add(new FloatRange(c.hue(), c.hue()));
        saturationConstraint
                .add(new FloatRange(c.saturation(), c.saturation()));
        brightnessConstraint
                .add(new FloatRange(c.brightness(), c.brightness()));
        alphaConstraint.add(new FloatRange(c.alpha(), c.alpha()));
        return this;
    }
View Full Code Here

     * @param min
     * @param max
     * @return itself
     */
    public ColorRange addAlphaRange(float min, float max) {
        return addAlphaRange(new FloatRange(min, max));
    }
View Full Code Here

     * @param min
     * @param max
     * @return itself
     */
    public ColorRange addBrightnessRange(float min, float max) {
        return addBrightnessRange(new FloatRange(min, max));
    }
View Full Code Here

     *
     * @param hue
     * @return itself
     */
    public ColorRange addHue(Hue hue) {
        hueConstraint.add(new FloatRange(hue.getHue(), hue.getHue()));
        return this;
    }
View Full Code Here

     * @param max
     * @return itself
     */
    public ColorRange addHueRange(float min, float max) {
        if (max >= min) {
            addHueRange(new FloatRange(min, max));
        } else {
            addHueRange(new FloatRange(min, 1));
            addHueRange(new FloatRange(0, max));
        }
        return this;
    }
View Full Code Here

     * @param min
     * @param max
     * @return itself
     */
    public ColorRange addSaturationRange(float min, float max) {
        return addAlphaRange(new FloatRange(min, max));
    }
View Full Code Here

        ColorRange range = new ColorRange();
        range.name = name;

        if (c != null) {
            float hue = c.hue() + variance * MathUtils.normalizedRandom();
            range.hueConstraint = new GenericSet<FloatRange>(new FloatRange(
                    hue, hue));
            range.alphaConstraint = new GenericSet<FloatRange>(new FloatRange(
                    c.alpha(), c.alpha()));
        } else {
            range.hueConstraint = hueConstraint.copy();
            range.alphaConstraint = alphaConstraint.copy();
        }
View Full Code Here

TOP

Related Classes of toxi.util.datatypes.FloatRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.