其他分享
首页 > 其他分享> > Color3f

Color3f

作者:互联网

Color3f

package com.vfsd.core;

import com.vfsd.core.Tuple3d;
import com.vfsd.core.Tuple3f;
import java.awt.Color;
import java.io.Serializable;

public class Color3f extends Tuple3f implements Serializable {
    static final long serialVersionUID = -1861792981817493659L;

    public Color3f(float arg0, float arg1, float arg2) {
        super(arg0, arg1, arg2);
    }

    public Color3f(float[] arg0) {
        super(arg0);
    }

    public Color3f(Color3f arg0) {
        super(arg0);
    }

    public Color3f(Tuple3f arg0) {
        super(arg0);
    }

    public Color3f(Tuple3d arg0) {
        super(arg0);
    }

    public Color3f(Color arg0) {
        super((float) arg0.getRed() / 255.0F, (float) arg0.getGreen() / 255.0F, (float) arg0.getBlue() / 255.0F);
    }

    public Color3f() {
    }

    public final void set(Color arg0) {
        this.x = (float) arg0.getRed() / 255.0F;
        this.y = (float) arg0.getGreen() / 255.0F;
        this.z = (float) arg0.getBlue() / 255.0F;
    }

    public final Color get() {
        int arg0 = Math.round(this.x * 255.0F);
        int arg1 = Math.round(this.y * 255.0F);
        int arg2 = Math.round(this.z * 255.0F);
        return new Color(arg0, arg1, arg2);
    }
}

 

标签:arg0,float,public,255.0,super,Color3f
来源: https://www.cnblogs.com/herd/p/14351548.html