Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isMulticolor not supported? #11

Closed
Twansparant opened this issue May 23, 2022 · 2 comments
Closed

isMulticolor not supported? #11

Twansparant opened this issue May 23, 2022 · 2 comments
Assignees
Labels
done Done and released good first issue Good for newcomers

Comments

@Twansparant
Copy link

Twansparant commented May 23, 2022

Hi there,

I just discovered your plugin, great work thanks!

The only reason I'm using IcoMoon in this project I'm currently developing and not Grunt webfont for example, is because I needed a Duotone icon font, following this guide. It all works well, the downloaded demo files are in duotone but IcoMoon uses <span> inside the <i> to override the colors.

In my selection.json file I can see all the color definitions in every icon, for example:

{
    "icons":
    [
        {
            "attrs":
            [
                {
                    "fill": "rgb(244, 159, 64)"
                },
                {
                    "fill": "rgb(0, 0, 0)"
                },
                {
                    "fill": "rgb(0, 0, 0)"
                }
            ],
            "icon":
            {
                "attrs":
                [
                    {
                        "fill": "rgb(244, 159, 64)"
                    },
                    {
                        "fill": "rgb(0, 0, 0)"
                    },
                    {
                        "fill": "rgb(0, 0, 0)"
                    }
                ],
                "colorPermutations":
                {
                    "1244159641":
                    [
                        {
                            "f": 1
                        },
                        {
                            "f": 0
                        },
                        {
                            "f": 0
                        }
                    ]
                },
                "grid": 0,
                "isMulticolor": true,
                "isMulticolor2": false,
                "paths":
                [
                    "M761.6 675.2c25.6 0 44.8-19.2 44.8-44.8v-217.6c0-25.6-19.2-44.8-44.8-44.8h-697.6v304h697.6zM448 425.6c0-6.4 6.4-12.8 12.8-12.8h41.6c9.6 0 12.8 9.6 9.6 16l-28.8 76.8h28.8c9.6 0 16 9.6 9.6 19.2l-60.8 102.4c-3.2 6.4-16 3.2-16-3.2l9.6-83.2h-28.8c-6.4 0-12.8-6.4-12.8-12.8l35.2-102.4z",
                    "M992 412.8c-19.2 0-32 16-32 32v108.8c0 19.2 16 32 32 32s32-16 32-32v-105.6c0-19.2-16-35.2-32-35.2z",
                    "M848 240h-784c-35.2 0-64 28.8-64 64v412.8c0 35.2 28.8 64 64 64h784c35.2 0 64-28.8 64-64v-412.8c3.2-35.2-25.6-64-64-64zM848 675.2c0 25.6-19.2 44.8-44.8 44.8h-694.4c-25.6 0-44.8-19.2-44.8-44.8v-326.4c0-25.6 19.2-44.8 44.8-44.8h697.6c25.6 0 44.8 19.2 44.8 44.8l-3.2 326.4z"
                ],
                "tags":
                [
                    "battery"
                ]
            },
            "iconIdx": 0,
            "properties":
            {
                "code": 59648,
                "codes":
                [
                    59648,
                    59649,
                    59650
                ],
                "id": 2,
                "name": "battery",
                "order": 2,
                "prevSize": 32
            },
            "setId": 0,
            "setIdx": 0
        },
    ],
}

In the field settings I used both Icon element (HTML) as SVG element as return value;
Icon stays blank (because it's missing the spans), SVG is rendered correctly but in monotone (because it's missing the colors).

Is this currently not supported (yet) in your plugin?
Thanks a lot!

@phucbm phucbm self-assigned this May 24, 2022
@phucbm
Copy link
Member

phucbm commented May 26, 2022

Hi @Twansparant,

Thank you for reaching out. You're right, our plugin has not supported multicolor render yet.
But we will soon make an update to add this feature.

Kindly bear with us till then.

@phucbm phucbm added good first issue Good for newcomers in progress labels May 26, 2022
phucbm added a commit that referenced this issue Aug 23, 2022
phucbm added a commit that referenced this issue Aug 23, 2022
@daomapsieucap
Copy link
Member

Hi @Twansparant,

We've just released the new version 4.0.3 having the feature to return SVG type which supports multicolor. Please update the plugin to the latest version and let us know if it's working.

Thanks.

@phucbm phucbm added the done Done and released label Aug 24, 2022
@phucbm phucbm closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Done and released good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants