本文介紹了將 RGB 轉(zhuǎn)換為 HSV 并將 HSV 轉(zhuǎn)換為 RGB 的算法,范圍為 0-255的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!
問(wèn)題描述
我正在尋找從 RGB 到 HSV 的顏色空間轉(zhuǎn)換器,特別是對(duì)于兩個(gè)顏色空間的 0 到 255 范圍.
I am looking for color space converter from RGB to HSV, specifically for the range 0 to 255 for both color spaces.
推薦答案
我已經(jīng)使用這些很長(zhǎng)時(shí)間了 - 現(xiàn)在不知道它們來(lái)自哪里......注意輸入和輸出,除了角度以度為單位,范圍為 0 到 1.0.
I've used these for a long time - no idea where they came from at this point... Note that the inputs and outputs, except for the angle in degrees, are in the range of 0 to 1.0.
注意:此代碼不會(huì)對(duì)輸入進(jìn)行真正的健全性檢查.謹(jǐn)慎行事!
NOTE: this code does no real sanity checking on inputs. Proceed with caution!
這篇關(guān)于將 RGB 轉(zhuǎn)換為 HSV 并將 HSV 轉(zhuǎn)換為 RGB 的算法,范圍為 0-255的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!