/*
 * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import * as React from "react";
import type { SVGIconProps } from "../../svgIconProps";
import { IconSize } from "../../iconTypes";
import { SVGIconContainer } from "../../svgIconContainer";

/** Path data for the 16px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_16 = ["M3.093 7q.025-.075.058-.15c.106-.248.225-.397.263-.436L7 2.828 11.172 7zM6.5 13c1 0 2.5-1 3-1.5l3.086-3.086L14 7l-1.414-1.414-4.172-4.172L7 0 5.586 1.414 2 5c-.5.5-1 1.5-1 2.5s.5 2 1 2.5l2 2c.5.5 1.5 1 2.5 1m7-4 1.125 1.667c.238.353.375.666.375 1 0 .666-.375 1.333-1.5 1.333s-1.5-.667-1.5-1.333c0-.334.137-.647.375-1zM0 15a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H1a1 1 0 0 1-1-1"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M2.188 9c.217-.52.623-.983 1.226-1.586L8 2.828 14.172 9zM8 0 6.586 1.414 2 6c-1 1-2 2.11-2 4 0 2 1 3 2 4l1 1c1 1 2 2 4 2 2.009 0 2.918-.913 3.868-1.867L11 15l4.586-4.586L17 9l-1.414-1.414-6.172-6.172zm10.5 13.5L17 11l-1.5 2.5c-.318.53-.5 1-.5 1.5 0 1 .5 2 2 2s2-1 2-2c0-.5-.182-.97-.5-1.5M1 18a1 1 0 1 0 0 2h18a1 1 0 1 0 0-2z"] as readonly string[];

export const ColorFill: React.FC<SVGIconProps> = React.forwardRef<any, SVGIconProps>((props, ref) => {
    const isLarge = (props.size ?? IconSize.STANDARD) >= IconSize.LARGE;
    const paths = isLarge ? PATHS_20 : PATHS_16;
    return (
        <SVGIconContainer iconName="color-fill" ref={ref} {...props}>
            {paths.map((d, i) => (
                <path key={i} d={d} fillRule="evenodd" />
            ))}
        </SVGIconContainer>
    );
});
ColorFill.displayName = `Blueprint6.Icon.ColorFill`;
export default ColorFill;
