Skip to content

Limit function #19

Open
Open
@schroef

Description

@schroef

I bumped into this lib by search for checking color relevance. I got a python example which can order them by relevance using a limit as well. So instead of returning 1 color, it returns an ordered list with a preset limit..

Is such a thing possible?

This example transform the RGB values to a vector list and then uses .length. I dont fully understand/know what .lenght is though in vector lists. I was think 3d points, but since these are its different i guess?!

def relevance(rgb1, rgb2):
        if isinstance(rgb1, RGB) and isinstance(rgb2, RGB):
            relevancelengtn = (__class__.rgb_to_vector(rgb1) - __class__.rgb_to_vector(rgb2)).length
            return 1 - relevancelengtn / __class__.__relevance0
        else:
            return 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions