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

📄 e585. converting between rgb and hsb colors.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
This example demonstrates how to convert between a color value in RGB (three integer values in the range 0 to 255 representing red, green, and blue) and HSB (three floating point values in the range 0 to 1.0 representing hue, saturation, and brightness). 
    // Specify 3 RGB values
    int red = 0x33;
    int green = 0x66;
    int blue = 0x99;
    
    // Convert RGB to HSB
    float[] hsb = Color.RGBtoHSB(red, green, blue, null);
    float hue = hsb[0];          // .58333
    float saturation = hsb[1];   // .66667
    float brightness = hsb[2];   // .6
    
    // Convert HSB to RGB value
    int rgb = Color.HSBtoRGB(hue, saturation, brightness);
    red = (rgb>>16)&0xFF;
    green = (rgb>>8)&0xFF;
    blue = rgb&0xFF;

⌨️ 快捷键说明

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