开发者

Calculate RGB use intensity

开发者 https://www.devze.com 2023-03-15 10:05 出处:网络
I was making a Gauroud algorithm and when i had calculated point intensity on the edge I didn\'t know what to do with it. I tried to decide this problem like:

I was making a Gauroud algorithm and when i had calculated point intensity on the edge I didn't know what to do with it. I tried to decide this problem like:

    private int getPointRGB(double intensity)
    {
        float[] hsb=null;
        double newCrRed;
        double newCrGr;
        double newCrBlue;
        int nRGB;
//crRed, crGr, crBlue - primary components of edge RGB
        newCrRed = intensity*crRed;
        newCrGr = intensity*crGr;
        newCrBlue = intensity*crBlue;
        hsb = Color.RGBtoHSB((int)newCrRed, (int)newCrGr, (int)newCrBlue, null);
        nRGB = C开发者_运维问答olor.HSBtoRGB(hsb[0], hsb[1], hsb[2]);
     return(nRGB);
    }

am I right?


If none of the default color choosers are satisfactory, you can create your own custom chooser panel, as discussed in How to Use Color Choosers: Creating a Custom Chooser Panel. For example, you could implement the CIE 1976 color space, shown here.

0

精彩评论

暂无评论...
验证码 换一张
取 消