Examples of RGBColor


Examples of artofillusion.math.RGBColor

                set.viewerLowValue.getBlue());
        Color viewerHighValue = new Color(set.viewerHighValue.getRed(),
              set.viewerHighValue.getGreen(),
              set.viewerHighValue.getBlue());
        ViewerCanvas.surfaceColor = viewerSurface;
        ViewerCanvas.surfaceRGBColor = new RGBColor(viewerSurface.getRed()/255.0, viewerSurface.getGreen()/255.0, viewerSurface.getBlue()/255.0);
        ViewerCanvas.transparentColor = new RGBColor(viewerTransparent.getRed()/255.0, viewerTransparent.getGreen()/255.0, viewerTransparent.getBlue()/255.0);
        ViewerCanvas.lowValueColor = new RGBColor(viewerLowValue.getRed()/255.0, viewerLowValue.getGreen()/255.0, viewerLowValue.getBlue()/255.0);
        ViewerCanvas.highValueColor = new RGBColor(viewerHighValue.getRed()/255.0, viewerHighValue.getGreen()/255.0, viewerHighValue.getBlue()/255.0);
    }
View Full Code Here

Examples of casmi.graphics.color.RGBColor

        setSize(800, 600);
        for (int i = 0; i < crtx.xDimension/2; i++) {
            for (int j = 0; j < crtx.yDimension/2; j++) {
                for (int k = 0; k < crtx.cellsPerColumn/2; k++) {
                    Circle s = new Circle(30);
                    s.setFillColor(new RGBColor(0.25, 0.25, 0.9, 0.7));
                    s.setStrokeColor(new RGBColor(0.25, 0.9, 0.25, 1.0));
                    s.setPosition((i*30)+200, (j*30)+150, (k*30));
                    addObject(s);
                    cells.add(s);
                }
            }
View Full Code Here

Examples of com.scriptographer.ai.RGBColor

      if ("".equals(name))
        return Color.NONE;
      try {
        // Try hex string first
        String str = name.startsWith("#") ? name : "#" + name;
        return new RGBColor(java.awt.Color.decode(str));
      } catch (Exception e1) {
        try {
          // If that does not work, try accessing the static Color.NAME field
          Field field = java.awt.Color.class.getField(name.toUpperCase());
          return new RGBColor((java.awt.Color) field.get(java.awt.Color.class));
        } catch (Exception e2) {
        }
      }
    } else if (reader.isArray()) {
      int size = reader.size();
      if (size == 4) {
        // CMYK
        return new CMYKColor(
            reader.readFloat(0),
            reader.readFloat(0),
            reader.readFloat(0),
            reader.readFloat(0)
        );
      } else  if (size == 3) {
        // RGB
        return new RGBColor(
            reader.readFloat(0),
            reader.readFloat(0),
            reader.readFloat(0)
        );
      } else  if (size == 1) {
        // Gray
        return new GrayColor(
            reader.readFloat(0)
        );
      }
    } else if (reader.isMap()) {
      if (reader.has("red")) {
        return new RGBColor(
            reader.readFloat("red", 0),
            reader.readFloat("green", 0),
            reader.readFloat("blue", 0),
            reader.readFloat("alpha", 1)
        );
View Full Code Here

Examples of com.scriptographer.ai.RGBColor

    if (javaObj instanceof Style)
      return new StyleWrapper(scope, (Style) javaObj, staticType, true);
    else if (javaObj instanceof Color)
      return new ColorWrapper(scope, (Color) javaObj, staticType, true);
    else if (javaObj instanceof java.awt.Color)
      return new ColorWrapper(scope, new RGBColor(
          (java.awt.Color) javaObj), staticType, true);
    else {
      Function ctor = mappedJavaClasses.get(staticType);
      if (ctor != null) {
        // If this native object was explicitly created from JS,
View Full Code Here

Examples of com.scriptographer.ai.RGBColor

          }
          return values;
        }
      } else if (unwrapped instanceof java.awt.Color
          && Color.class.equals(type)) {
        return new RGBColor((java.awt.Color) unwrapped);
      } else if (unwrapped instanceof Color
          && java.awt.Color.class.equals(type)) {
        return ((Color) unwrapped).toAWTColor();
      }
    }
View Full Code Here

Examples of com.scriptographer.ai.RGBColor

    }
    break;
    case COLOR: {
      Color color = ScriptEngine.convertToJava(value, Color.class);
      if (color == null)
        color = new RGBColor(0, 0, 0);
      ((ColorButton) item).setColor(color);
    }
    break;
    case FONT: {
      FontWeight weight = ScriptEngine.convertToJava(value,
View Full Code Here

Examples of de.ailis.jollada.model.RGBColor

     *            The element attributes
     */

    private void enterLightColor(final Attributes attributes)
    {
        this.rgbColor = new RGBColor();
        this.rgbColor.setSid(attributes.getValue("sid"));
        this.stringBuilder = new StringBuilder();
        enterElement(ParserMode.LIGHT_COLOR);
    }
View Full Code Here

Examples of net.sourceforge.jiu.color.quantization.RGBColor

      case(METHOD_REPR_COLOR_AVERAGE):
      {
        int num = index2 - index1 + 1;
        for (int i = index1; i <= index2; i++)
        {
          RGBColor color = list.getColor(i);
          temp[0] += color.getSample(0);
          temp[1] += color.getSample(1);
          temp[2] += color.getSample(2);
        }
        result[0] = (int)(temp[0] / num);
        result[1] = (int)(temp[1] / num);
        result[2] = (int)(temp[2] / num);
        return result;
      }
      case(METHOD_REPR_COLOR_WEIGHTED_AVERAGE):
      {
        long num = 0;
        for (int i = index1; i <= index2; i++)
        {
          RGBColor color = list.getColor(i);
          int counter = color.getCounter();
          temp[0] += color.getSample(0) * counter;
          temp[1] += color.getSample(1) * counter;
          temp[2] += color.getSample(2) * counter;
          num += counter;
        }
        if (num == 0)
        {
          //System.out.println("ERROR IN FINDREPRESENTATIVECOLOR (WEIGHTED AVERAGE): ZERO COUNTER");
          return null;
        }
        result[0] = (int)(temp[0] / num);
        result[1] = (int)(temp[1] / num);
        result[2] = (int)(temp[2] / num);
        return result;
      }
      case(METHOD_REPR_COLOR_MEDIAN):
      {
        RGBColor color = list.getColor((index1 + index2) / 2);
        result[0] = color.getSample(0);
        result[1] = color.getSample(1);
        result[2] = color.getSample(2);
        return result;
      }
      default: throw new IllegalStateException("Unknown method for determining a representative color.");
    }
  }
View Full Code Here

Examples of net.sourceforge.jiu.color.quantization.RGBColor

   
    list.sortByAxis(node.getLeftIndex(), node.getRightIndex(), node.getAxisOfLargestDistribution());
    int middleIndex = node.getMiddleIndex();
    int leftIndex = node.getLeftIndex();
    int rightIndex = node.getRightIndex();
    RGBColor color = list.getColor(middleIndex);
    int axis = node.getAxisOfLargestDistribution();
    int medianValue = color.getSample(axis);
    node.setMedianValue(medianValue);
    if (leftIndex == rightIndex)
    {
      throw new IllegalArgumentException("Cannot split leaf that only holds one color. This should never happen.");
    }
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.RGBColor

  }
  return OS.eventNotHandledErr;
}

RGBColor toRGBColor (float [] color) {
  RGBColor rgb = new RGBColor ();
  rgb.red = (short) (color [0] * 0xffff);
  rgb.green = (short) (color [1] * 0xffff);
  rgb.blue = (short) (color [2] * 0xffff);
  return rgb;
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.