此处使用哪些值作为参考来计算颜色代码? [英] What values are used as reference to calculate the color code here?

查看:166
本文介绍了此处使用哪些值作为参考来计算颜色代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一个.jar文件,该文件从图像生成整数颜色代码的矩阵。

I was given a .jar file which generates a matrix of integer color codes from an image.

我可以判断出黑色值为-16777216,并且白色为-1。但是,我以前从未见过这样的用于颜色代码的值

I can tell that the black color value is -16777216, and white is -1. However, I have never seen such values used for color codes before.

我在.jar文件中看不到代码。

I can't see the code within the .jar file.

本可以在类似Graphic Design SE的地方问这个问题,但我想这里的编码员以前更可能遇到类似的问题。

Could have asked this somewhere like Graphic Design SE, but I guess it is more possible that a coder here has worked with similar problems before.

我想找到一个引用表格/任何内容的原因是因为我希望能够基于这样的值获得颜色名称。

The reason I want to find a reference "table/whatever" is because I would like to be able to get the color name based on such values.

编辑:这是我得到的一些颜色:

EDIT: Here are some colors I got:


  • 黑色是-16777216

  • 红色为-65536

  • 绿色为-16711936

  • 蓝色为-16776961

  • 白色为-1

  • Black is -16777216
  • Red is -65536
  • Green is -16711936
  • Blue is -16776961
  • White is -1

推荐答案

以十六进制格式给出的颜色值更容易理解,用 0x指定,后跟0-9或AF。此处,黑色为0xFF000000,白色为0xFFFFFFFF。格式为0xAARRGGBB,其中 AA是 alpha组件的两个十六进制数字(00完全透明,FF完全不透明), RR, GG和 BB是红色/绿色/蓝色

Color values are more easily understood when given in hexadecimal format, specified with "0x" followed by 0-9 or A-F. Here, black is 0xFF000000, and white is 0xFFFFFFFF. The format is 0xAARRGGBB, where "AA" is two hexadecimal digits for the "alpha" component (00 is completely transparent, FF is completely opaque), "RR", "GG", and "BB" are the red/green/blue components, respectively.

0xFF000000恰好是-16777216,而0xFFFFFFFF则是-1。

0xFF000000 happens to be -16777216, and 0xFFFFFFFF is -1.

编辑:固定-16777216值。

Fixed -16777216 value.

这篇关于此处使用哪些值作为参考来计算颜色代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆