SVBar.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:microMathematics 作者:
/**
 * Set the bar color. <br>
 * <br>
 * Its discouraged to use this method.
 * 
 * @param color
 */
public void setColor(int color) {
    int x1, y1;
    if (mOrientation) {
        x1 = (mBarLength + mBarPointerHaloRadius);
        y1 = mBarThickness;
    } else {
        x1 = mBarThickness;
        y1 = (mBarLength + mBarPointerHaloRadius);
    }

    Color.colorToHSV(color, mHSVColor);
    shader = new LinearGradient(mBarPointerHaloRadius, 0, x1, y1,
            new int[] { Color.WHITE, color, Color.BLACK }, null,
            Shader.TileMode.CLAMP);
    mBarPaint.setShader(shader);
    calculateColor(mBarPointerPosition);
    mBarPointerPaint.setColor(mColor);
    if (mPicker != null) {
        mPicker.setNewCenterColor(mColor);
        if (mPicker.hasOpacityBar())
            mPicker.changeOpacityBarColor(mColor);
    }
    invalidate();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号