Skip to content

Function to determine if a color parsed or used the default #61

Open
@ghost

Description

var fixedDefaultString = "#abcdef";
jQuery.Color.names["_default"] = fixedDefaultString;
var defaultColor = jQuery.Color("_default");
var parsedAsDefault = jQuery.Color("#abcdef");
var unparsed = jQuery.Color("I AM THE KING POTATO");

It would be nice to have a way to determine that unparsed is using the default, whereas parsedAsDefault is not. Ideally, it would be available after construction via something like .isParseable().

I'm unclear on what isParseable() should return in cases that do not involve parsing a string, however. For example:

jQuery.Color(100, 100, 100, 100).isParseable();
jQuery.Color().isParseable();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions