Python webcolors.css21_names_to_hex() Examples

The following are 9 code examples of webcolors.css21_names_to_hex(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module webcolors , or try the search function .
Example #1
Source File: _format.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance) 
Example #2
Source File: _format.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance) 
Example #3
Source File: _format.py    From core with MIT License 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance) 
Example #4
Source File: _format.py    From deepWordBug with Apache License 2.0 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance) 
Example #5
Source File: _format.py    From accelerated-data-lake with Apache License 2.0 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance) 
Example #6
Source File: _format.py    From Requester with MIT License 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance) 
Example #7
Source File: _format.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance) 
Example #8
Source File: _format.py    From SA-ctf_scoreboard with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance) 
Example #9
Source File: _format.py    From pyblish-qml with GNU Lesser General Public License v3.0 5 votes vote down vote up
def is_css21_color(instance):
        if (
            not isinstance(instance, str_types) or
            instance.lower() in webcolors.css21_names_to_hex
        ):
            return True
        return is_css_color_code(instance)