本文介紹了將 RGB 轉換為 HSV 并將 HSV 轉換為 RGB 的算法,范圍為 0-255的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在尋找從 RGB 到 HSV 的顏色空間轉換器,特別是對于兩個顏色空間的 0 到 255 范圍.
I am looking for color space converter from RGB to HSV, specifically for the range 0 to 255 for both color spaces.
推薦答案
我已經使用這些很長時間了 - 現在不知道它們來自哪里......注意輸入和輸出,除了角度以度為單位,范圍為 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.
注意:此代碼不會對輸入進行真正的健全性檢查.謹慎行事!
NOTE: this code does no real sanity checking on inputs. Proceed with caution!
這篇關于將 RGB 轉換為 HSV 并將 HSV 轉換為 RGB 的算法,范圍為 0-255的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!