Exemplo n.º 1
0
    SkColor genColor(SkRandom* rand) {
        SkScalar hsv[3];
        hsv[0] = rand->nextRangeF(0.0f, 360.0f);
        hsv[1] = rand->nextRangeF(0.75f, 1.0f);
        hsv[2] = rand->nextRangeF(0.75f, 1.0f);

        return sk_tool_utils::color_to_565(SkHSVToColor(hsv));
    }
Exemplo n.º 2
0
    SkColor genColor(SkRandom* rand) {
        SkScalar hsv[3];
        hsv[0] = rand->nextRangeF(0.0f, 360.0f);
        hsv[1] = rand->nextRangeF(0.75f, 1.0f);
        hsv[2] = rand->nextRangeF(0.75f, 1.0f);

        return SkHSVToColor(hsv);
    }
Exemplo n.º 3
0
SkColor PlatformThemeChromiumLinux::saturateAndBrighten(const SkScalar hsv[3], SkScalar saturateAmount, SkScalar brightenAmount)
{
    SkScalar color[3];
    color[0] = hsv[0];
    color[1] = clamp(hsv[1] + saturateAmount, 0.0, 1.0);
    color[2] = clamp(hsv[2] + brightenAmount, 0.0, 1.0);
    return SkHSVToColor(color);
}
Exemplo n.º 4
0
static int Color_HSVToColor(JNIEnv* env, jobject, int alpha, jfloatArray hsvArray)
{
    AutoJavaFloatArray  autoHSV(env, hsvArray, 3);
    float*      values = autoHSV.ptr();;
    SkScalar    hsv[3];

    for (int i = 0; i < 3; i++) {
        hsv[i] = SkFloatToScalar(values[i]);
    }
    
    return SkHSVToColor(alpha, hsv);
}