Demos and Usage of java.awt.Color.getHSBColor(float h,float s,float b)


   1: 
   2: import java.awt.Color;
   3: import java.awt.Graphics2D;
   4:         ...
   5: 
   6:     public FanRenderer(int triangleCount, Color baseColor) {
   7:         this(createSectors(triangleCount, baseColor));
   8:         ...
   9:     
  10:     public static Triangle[] createSectors(int count, Color baseColor) {
  11:         Triangle[] result = new Triangle[count];
  12:         ...
  13:         float brightness = 0.8f + random.nextFloat() * 0.2f;
  14:         return Color.getHSBColor(hsb[0], hsb[1], brightness);

View Full Code Here
   1:    
   2:     public static Color lighten(Color col)
   3:     {
   4:         ...
   5:        
   6:        float[] hsb = Color.RGBtoHSB(red, green, blue, null);
   7:         ...
   8:        return Color.getHSBColor(hsb[0], 0.3f, hsb[2]);
   9:     }

View Full Code Here
   1:     return new InfoNodeLookAndFeelTheme("Dark Blue Green Theme",
   2:                                         Color.getHSBColor(hue, saturation, 0.5f),
   3:         ...
   4:                                         Color.getHSBColor(hue, saturation + 0.1f, 0.9f),
   5:         ...
   6:                                         Color.getHSBColor(Colors.SAND_HUE, 0.04f, 0.5f),
   7:         ...
   8:                                         Color.WHITE,

View Full Code Here
   1: 
   2: import java.awt.Color;
   3: 
   4:         ...
   5:             a.setPolygonAttributes(new PolygonAttributes(attribute, PolygonAttributes.CULL_NONE, 0));
   6:             Color selectedColor;
   7:             if (on) selectedColor = highlightColor;
   8:         ...
   9:             Material m = new Material();
  10:             Color selectedColor;
  11:             if (on) selectedColor = highlightColor;
  12:         ...
  13:             float[] hsb = Color.RGBtoHSB(selectedColor.getRed(), selectedColor.getGreen(), selectedColor.getBlue(), null);
  14:             Color.getHSBColor(hsb[0],hsb[1]/10,1.0f).getRGBColorComponents(colors);

View Full Code Here
   1: 
   2: import java.awt.Color;
   3: import java.awt.Paint;
   4:         ...
   5:                 Paint p = super.getNextPaint();
   6:                 if ((x_ary>1) && (p instanceof Color)) {
   7:         ...
   8:                     Color c = ((Color)p);
   9:                     float[] hsb = Color.RGBtoHSB(c.getRed(),c.getGreen(),c.getBlue(),new float[3]);
  10:         ...
  11:                     if (hsb[0]>1) hsb[0] -=1;
  12:                     return Color.getHSBColor(hsb[0], hsb[1], hsb[2]);

View Full Code Here
   1: 
   2: import java.awt.Color;
   3: 
   4:         ...
   5:             a.setPolygonAttributes(pa);
   6:             Color selectedColor;
   7:             if (on) selectedColor = highlightColor;
   8:         ...
   9:             Material m = new Material();
  10:             Color selectedColor;
  11:             if (on) selectedColor = highlightColor;
  12:         ...
  13:             float[] hsb = Color.RGBtoHSB(selectedColor.getRed(), selectedColor.getGreen(), selectedColor.getBlue(), null);
  14:             Color.getHSBColor(hsb[0],hsb[1]/10,1.0f).getRGBColorComponents(colors);

View Full Code Here
   1: package org.opensourcephysics.display2d;
   2: import java.awt.Color;
   3: import javax.swing.JFrame;
   4:         ...
   5:   private double ceil;
   6:   private Color ceilColor = Color.lightGray;
   7:   private JFrame legendFrame;
   8:   int[] reds = new int[256];
   9:   int[] greens = new int[256];

View Full Code Here
   1: 
   2: import java.awt.Color;
   3: import java.awt.Component;
   4:         ...
   5:     protected static class ColorEditor extends DefaultCellEditor {
   6:         Color currentColor = null;
   7: 
   8:         ...
   9:             ((JButton)editorComponent).setText(value.toString());
  10:             currentColor = (Color)value;
  11:             return editorComponent;
  12:         ...
  13:         defaultColorIndex++;
  14:         return Color.getHSBColor(h, s, b);

View Full Code Here
   1: 
   2: import java.awt.Color;
   3: import java.io.Serializable;
   4:         ...
   5:     if(posx+powerw+1 > lastPosx)return;
   6:     g2.setColor(Color.BLUE);
   7:     g2.fillRect(posx+powerw,0,1,boardHeight);    
   8:         ...
   9:     int posy = boardHeight - kHzLevel;
  10:     g2.setColor(Color.gray);
  11:     g2.fillRect(0,posy,boardWidth,1);
  12:         ...
  13:     hsb = Color.RGBtoHSB(r,g,b,hsb);
  14:     return Color.getHSBColor(hsb[0], hsb[1], hsb[2]); 

View Full Code Here