Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
hue = (int)Math.Round(60 * ((double)(r - g) / sat + 4));
これは、r、g、および sat の値がすべてゼロの場合に、hue を -2147483288 に設定しています。どんな助けでも大歓迎です!編集:これはC#です
あなたは0で割っています。つまり、satは0です。どのプログラミング言語でも絶対にお勧めできません。sat = 0 の場合は、特別なケースが必要です。
if(sat==0) hue = 0; else hue = (int)Math.Round(60 * ((double)(r - g) / sat + 4));