jfcherng-sublime / ST-ASS

ASS/SSA subtitles syntax highlight for Sublime Text.
MIT License
26 stars 2 forks source link

feat: use ColorHelper plugin to visualize colors #9

Closed jfcherng closed 3 years ago

jfcherng commented 3 years ago

Resolves https://github.com/jfcherng-sublime/ST-ASS/issues/6

With ColorHelper 3.5.0 and following settings with it:

{
    "user_color_rules": [
        {
            // ASS ( based on: https://packagecontrol.io/packages/Advanced%20Substation%20Alpha%20(ASS) )
            "name": "ASS",
            "base_scopes": ["text.ass"],
            "scanning": ["constant.other.color"],
            "color_class": "and_h_abgr",
            "color_trigger": "", // "constant.other.color" scope is already accurate for colors
        },
    ],
    "user_color_classes": {
        "and_h_abgr": {
            "class": "Advanced Substation Alpha (ASS).plugin.color_helper.and_h_abgr.ColorAlphaHex",
            "filters": ["srgb"],
            "output": [
                {
                    "space": "srgb",
                    "format": { "upper": true },
                },
            ],
        },
    },
}

Screenshot

Snipaste_2021-09-06_15-41-56

jfcherng commented 3 years ago

@FichteFoll Could you test this? And what do you think about removing the built-in inferior color phantoms?

facelessuser commented 3 years ago

This is now merged into ColorHelper and will be present in the st3-3.6.0 release. I will most likely cut a release today sometime. Glad to see people starting to play with custom color class support to extend ColorHelper. Hopefully, it wasn't too painful to figure out.

jfcherng commented 3 years ago

@facelessuser Thanks for taking that :)