 ) {
     switch (style) {
         case BORDER_STYLE_DOUBLE: {
+            // Get the distances from 0.33 of the radii, and
+            // also 0.67 of the radii. Use these to form a
+            // SDF subtraction which will clip out the inside
+            // third of the rounded edge.
             float d_radii_a = distance_to_ellipse(
                 clip_relative_pos,
                 clip_radii.xy - vPartialWidths.xy,

                aa_range
            );
            float alpha = distance_aa(aa_range, d);

            vec4 c0, c1;
            switch (segment) {
                case SEGMENT_TOP_LEFT:
                    c0 = color[1];
                    c1 = color[0];
                    break;
                case SEGMENT_TOP_RIGHT:
                    c0 = mix(color[1], color[0], mix_factor);
                    c1 = mix(color[0], color[1], mix_factor);
                    break;
                case SEGMENT_BOTTOM_RIGHT:
                    c0 = color[0];
                    c1 = color[1];
                    break;
                case SEGMENT_BOTTOM_LEFT:
                    c0 = mix(color[0], color[1], mix_factor);
                    c1 = mix(color[1], color[0], mix_factor);
                    break;
                default:
                    break;
            }

            return mix(c0, c1, alpha);
        }
        default:

    return vec4(clamp(color.rgb * f, vec3(0.0), vec3(color.a)), color.a);
}

vec4[2] get_colors_for_side(vec4 color, int style) {
    vec4 result[2];
    const vec2 f = vec2(1.3, 0.7);

    switch (style) {
        case BORDER_STYLE_GROOVE:
            result[0] = mod_color(color, f.x);
            result[1] = mod_color(color, f.y);
            break;
        case BORDER_STYLE_RIDGE:
            result[0] = mod_color(color, f.y);
            result[1] = mod_color(color, f.x);
            break;
        default:
            result[0] = color;
            result[1] = color;
            break;
    }

    return result;
}

void main(void) {
    int segment = aFlags & 0xff;
    int style0 = (aFlags >> 8) & 0xff;
