Skip to main content
. 2025 Jun 5;25(11):3572. doi: 10.3390/s25113572
Algorithm A2 Get the name of an RGB color
  • 1:

    function get_color_name( rgb_color )

  • 2:

        try

  • 3:

           return  webcolors.rgb_to_name(rgb_color)

  • 4:

        catch ValueError

  • 5:

           return closest_color( rgb_color )

  • 6:

    end function