“Rounding” colour values to the nearest of a small set of colours

前端 未结 4 1674
予麋鹿
予麋鹿 2020-12-02 06:48

Preamble

As a part of a project I\'m working on I am trying to provide a convenient way to search for images in our system. We currently provide se

4条回答
  •  悲&欢浪女
    2020-12-02 07:28

    Depending on the number of colors you're looking for, why not try using bitwise operators (PHP's reference here, since you mentioned it in the question) to reduce the number of significant digits? You could round the RGB values before shifting to increase accuracy as well.

提交回复
热议问题