Java Color Distance distanceToColor(final int distance)

Here you can find the source of distanceToColor(final int distance)

Description

distance To Color

License

Open Source License

Declaration

public static int distanceToColor(final int distance) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;

public class Main {
    /**//from   w w w. j  a v a2 s .  co  m
     * {@value}
     */
    public static final int INTENSITY_MAX = 255;

    public static int distanceToColor(final int distance) {
        return new Color(INTENSITY_MAX - distance, INTENSITY_MAX - distance, INTENSITY_MAX - distance,
                INTENSITY_MAX).getRGB();
    }
}

Related

  1. colorDistance(final float[] lab1, final float[] lab2)
  2. colorDistance(final float[] lab1, final float[] lab2)
  3. colorDistance(int r1, int g1, int b1, int r2, int g2, int b2)
  4. distance(Color a, Color b)
  5. distance(Color c1, Color c2)
  6. drawArc(Point2D start, double distance, double startAngle, double arcAngle, boolean fill, Graphics2D g2, Color color)
  7. getDistance(int c1, Color c2)
  8. getMaxDistance(final Color first, final Color second)
  9. pixelDistance(final Color col1, final Color col2)