Skip to content

Migration from v0 to v1 guidelines

Ramojus Lapinskas edited this page Aug 30, 2024 · 16 revisions

This wiki page will be relevant when v1 is released.

Changes for color_overrides option (#45)

color_overrides changed from:

require('mellifluous').setup({
    <colorset_name> = {
        color_overrides = {
            dark = {
                <new_colors>
            },
            light = {
                <new_colors>
            }
        }
    }
})

To:

require('mellifluous').setup({
    <colorset_name> = {
        color_overrides = {
            dark = {
                bg = function(bg) -- some colorset colors might depend on bg
                    return <new_bg>
                end,
                colors = function(colors)
                    return {
                        <new_colors> -- check "Available colors" section in Readme for colors that can be used and overriden
                    }
                end,
            },
            light = {
                bg = function(bg)
                    return <new_bg>
                end,
                colors = function(colors)
                    return {
                        <new_colors>
                    }
                end,
            }
        }
    }
})

Global colorset overrides can also be set - just omit <colorset_name> table.

Rename of color_set to colorset (#46)

Color set was renamed colorset. Config changed from:

require('mellifluous').setup({
    color_set = <colorset_name>
})

To:

require('mellifluous').setup({
    colorset = <colorset_name>
})

Changes in config for styles (#57)

Configurable styles changed from:

require('mellifluous').setup({
    styles = {
        comments = { italic = true },
        conditionals = {},
        folds = {},
        loops = {},
        functions = {},
        keywords = {},
        strings = {},
        variables = {},
        numbers = {},
        booleans = {},
        properties = {},
        types = {},
        operators = {},
        markup = {
            headings = { bold = true },
        },
    },
})

To:

require('mellifluous').setup({
    styles = {
        main_keywords = {},
        other_keywords = {},
        types = {},
        operators = {},
        strings = {},
        functions = {},
        constants = {},
        comments = { italic = true },
        markup = {
            headings = { bold = true },
        },
        folds = {},
    },
})

Removal of bg_contrast option for mellifluous colorset (#60)

This was done in favor of using the new color overrides that allow overriding background before the shades are applied. Config changed from:

require('mellifluous').setup({
    mellifluous = {
        bg_contrast = <"medium"/"soft"/"hard">
    },
})

To:

require('mellifluous').setup({
    mellifluous = {
        color_overrides = {
            dark = {
                bg = function(bg)
                    -- return bg:darkened(2) -- hard contrast
                    -- return bg -- medium contrast
                    -- return bg:lightened(2) -- soft contrast
                end,
            },
            light = {
                bg = function(bg)
                    -- return bg:lightened(2) -- hard contrast
                    -- return bg -- medium contrast
                    -- return bg:darkened(2) -- soft contrast
                end,
            },
        },
    },
})

Removal of meliora module

For long time users, config changed from:

require('meliora').setup({ ... })

To:

require('mellifluous').setup({ ... })

Deprecation of config.neutral (#59)

Again, for long time users, global option neutral was deprecated in favor of colorset specific config. Config changed from:

require('mellifluous').setup({
    neutral = <true/false>
})

To:

require('mellifluous').setup({
    mellifluous = {
        neutral = <true/false>
    }
})