首页 > 解决方案 > 如何获得最接近我的颜色变量的颜色?

问题描述

我有一个关于颜色以及如何入它们的问题。我需要能够获得最接近我的颜色变量的颜色。

例如,我有一种类似于橙色 ( 255, 119, 0 ) 的颜色,我需要它通过一个过程,直到它返回实际颜色橙色 ( 255,165,0 )。我不知道如何实现这一点。任何帮助将不胜感激。

标签: javacolorsrounding

解决方案


If I understood your question correctly, you are trying to check if the color passed in is close to your goal color (aks orange in your example). Store each of the numbers in an array and compare them by looping through & if statements ...


推荐阅读