java - 如何获得最接近我的颜色变量的颜色?
问题描述
我有一个关于颜色以及如何舍入它们的问题。我需要能够获得最接近我的颜色变量的颜色。
例如,我有一种类似于橙色 ( 255, 119, 0 ) 的颜色,我需要它通过一个过程,直到它返回实际颜色橙色 ( 255,165,0 )。我不知道如何实现这一点。任何帮助将不胜感激。
解决方案
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 ...
推荐阅读
- python - 在特定位置打开命令提示符,然后使用 python 在该位置运行带有一些命令行参数的脚本
- php - 从多维数组中取值
- regex - 我使用什么正则表达式来指定低于 1000000 的数字?
- wordpress - 当我登录和刷新仪表板时,在我的 wordpress 中自动注销
- java - Spring Boot 卡夫卡消息传递。如何简化处理程序的 dto 映射?
- ios - 视图高度换行子视图内容
- node.js - 为什么反应组件不在循环内工作?
- ios - 预定义的 IBDesignable
- fancybox-3 - 如何实现 Fancybox 3 的确认对话框?
- python - 如何在 pygame 和 pyopengl 中独立旋转 2 个对象