Package org.jwildfire.create.tina.palette

Examples of org.jwildfire.create.tina.palette.RGBColor$HSV


    private static final long serialVersionUID = 1L;

    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      if (data.paletteKeyFrames != null && data.paletteKeyFrames.size() > row) {
        RGBColor color = data.paletteKeyFrames.get(row);
        c.setBackground(new java.awt.Color(color.getRed(), color.getGreen(), color.getBlue()));
      }
      return c;
    }
View Full Code Here


      }
      else if (token.startsWith("index=") && tokenizer.hasMoreElements() && (nextToken = tokenizer.nextToken()).startsWith("color=")) {
        int index = Integer.parseInt(token.substring(6, token.length()));
        int colorValue = Integer.parseInt(nextToken.substring(6, nextToken.length()));
        pixel.setARGBValue(colorValue);
        RGBColor color = new RGBColor(pixel.b, pixel.g, pixel.r);
        colors.put(index, color);
      }
    }
    boolean doInterpolate = pUgr.contains("numnodes=");
    boolean doFade = pUgr.contains("smooth=yes");
    final int maxIdx = 399;
    if (doInterpolate) {
      if (colors.get(0) == null) {
        colors.put(0, new RGBColor(0, 0, 0));
      }
      if (colors.get(maxIdx) == null) {
        colors.put(maxIdx, new RGBColor(0, 0, 0));
      }
    }
    else {
      RGBColor lastColor = new RGBColor(0, 0, 0);
      for (int i = 0; i <= maxIdx; i++) {
        RGBColor color = colors.get(i);
        if (color == null) {
          colors.put(i, lastColor);
        }
        else {
          lastColor = color;
View Full Code Here

      markerColorSelYMax = yOff + 3 * size2;

      markerXMin[pMarkerIdx] = x - size2;
      markerXMax[pMarkerIdx] = x + size2;

      RGBColor color = pGradient.getColor(mPos);
      g.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue()));
      g.fillOval(x - size2 + 2, yOff + size2 + 2, 2 * size2 - 4, 2 * size2 - 4);
    }

  }
View Full Code Here

  private void drawGradient(Graphics2D g, RGBPalette pGradient) {
    g.setColor(FlamePanelConfig.XFORM_COLOR);
    g.drawRect(xMin - 1, yMin - 1, xMax - xMin + 1, yMax - yMin + 2);
    for (int i = 0; i < GRADIENT_SIZE; i++) {
      int cxMin = xPos[i], cxMax = xPos[i + 1] - 1;
      RGBColor color = pGradient.getColor(i);
      g.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue()));
      for (int cx = cxMin; cx <= cxMax && cx >= xMin && cx <= xMax; cx++) {
        g.drawLine(cx, yMin, cx, yMax);
      }
    }
  }
View Full Code Here

  public boolean gradientMarker_selectColor(int marker, RGBPalette pGradient) {
    if (marker >= 0) {
      ResourceManager rm = ResourceManager.all(FilePropertyEditor.class);
      String title = rm.getString("ColorPropertyEditor.title");

      RGBColor color = pGradient.getColor(markerPos[marker]);

      Color selectedColor = JColorChooser.showDialog(parent, title, new Color(color.getRed(), color.getGreen(), color.getBlue()));
      if (selectedColor != null) {

        pGradient.setColor(markerPos[marker], selectedColor.getRed(), selectedColor.getGreen(), selectedColor.getBlue());
        return true;
      }
View Full Code Here

  }

  public void pasteRange(RGBPalette pGradient) {
    if (currClipboard != null && currClipboard.length > 0) {
      for (int i = getFrom(); (i <= getTo()) && ((i - getFrom()) < currClipboard.length); i++) {
        RGBColor color = currClipboard[i - getFrom()];
        pGradient.setColor(i, color.getRed(), color.getGreen(), color.getBlue());
      }
    }
  }
View Full Code Here

  public void fadeAll(RGBPalette pGradient) {
    int startIdx = 0;//getFrom();
    int endIdx = GRADIENT_SIZE - 1; // getTo();
    for (int i = startIdx; i <= endIdx; i++) {
      RGBColor color = pGradient.getRawColor(i);
      if (color.getRed() > 0 || color.getGreen() > 0 || color.getBlue() > 0 || i == endIdx) {
        if (startIdx < i) {
          pGradient.fadeRange(startIdx, i);
          startIdx = i;
        }
      }
View Full Code Here

    if (img.getImageWidth() > 0 && img.getImageHeight() > 0) {
      Map<Integer, RGBColor> colors = new HashMap<Integer, RGBColor>();
      Pixel rgbPixel = new Pixel();
      for (int i = 0; i < img.getImageWidth(); i++) {
        rgbPixel.setARGBValue(img.getARGBValue(i, 0));
        RGBColor color = new RGBColor(rgbPixel.r, rgbPixel.g, rgbPixel.b);
        colors.put(i, color);
      }
      gradient.setColors(colors, false, false);
    }
    return res;
View Full Code Here

  }

  public String getGradientAsMap(RGBPalette pGradient) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < RGBPalette.PALETTE_SIZE; i++) {
      RGBColor color = pGradient.getRawColor(i);
      sb.append(alignColValue(color.getRed()));
      sb.append(" ");
      sb.append(alignColValue(color.getGreen()));
      sb.append(" ");
      sb.append(alignColValue(color.getBlue()));
      if (i == 0) {
        sb.append(" \"");
        sb.append(pGradient.getFlam3Name());
        sb.append("\", created with " + Tools.APP_TITLE + " " + Tools.APP_VERSION);
      }
View Full Code Here

      }
      catch (Exception ex) {
        break;
      }
      if (r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255) {
        RGBColor color = new RGBColor(r, g, b);
        colors.put(idx++, color);
      }
      else {
        break;
      }
View Full Code Here

TOP

Related Classes of org.jwildfire.create.tina.palette.RGBColor$HSV

Copyright © 2018 www.massapicom. 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.