⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rgb.java

📁 Java mulitplayer strategy game. Adaptation of KDE Galaxy Conquest. (rules are changed - but still th
💻 JAVA
字号:
package net.sf.jawp.gui.client.semi3d;


/**
 * 
 * @author from javaworld
 * @version $Revision: 1.2 $
 *
 */
public final class RGB
{
	double r, g, b;

	public RGB(final double r, final double g, final double b)
	{
		this.r = r;
		this.g = g;
		this.b = b;
	}

	public RGB(final int rgb)
	{
		r = (double) (rgb >> 16 & 0xff) / 255;
		g = (double) (rgb >> 8 & 0xff) / 255;
		b = (double) (rgb >> 0 & 0xff) / 255;
	}

	public void scale(final double scale)
	{
		r *= scale;
		g *= scale;
		b *= scale;
	}

	public void add(final RGB texel)
	{
		r += texel.r;
		g += texel.g;
		b += texel.b;
	}

	public int toRGB()
	{
		return 0xff000000 | (int) (r * 255.99) << 16 | (int) (g * 255.99) << 8
				| (int) (b * 255.99) << 0;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -