daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Aug 30th, 2018 8 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #@gui Colour Space Conversion: csconvert, csconvert_preview()
  2. #@gui : To RGB from = choice("RGB","sRGB","CMYK","CMY","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Lab8","Lab","YCbCr","YCbCr_2","YIQ8","YIQ","YUV8","YUV","Bayer","HCY","XYZ8","XYZ")
  3. #@gui : Multiply = float(1,-10,10)
  4. #@gui : Add = int(0,-256,256)
  5. #@gui : From RGB to = choice("RGB","sRGB","CMYK","CMY","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Lab8","Lab","YCbCr","YCbCr_2","YIQ8","YIQ","YUV8","YUV","Bayer","HCY","XYZ8","XYZ")
  6. csconvert:
  7. repeat $! l[$>] split_opacity l[0] to_rgb
  8. cs=$1
  9. sc=$4
  10. if {$cs==1} srgb2rgb
  11. elif {$cs==2} cmyk2rgb
  12. elif {$cs==3} cmy2rgb
  13. elif {$cs==4} hsv82rgb
  14. elif {$cs==5} hsv2rgb
  15. elif {$cs==6} hsl82rgb
  16. elif {$cs==7} hsl2rgb
  17. elif {$cs==8} hsi82rgb
  18. elif {$cs==9} hsi2rgb
  19. elif {$cs==10} lch82rgb
  20. elif {$cs==11} lch2rgb
  21. elif {$cs==12} lab82rgb
  22. elif {$cs==13} ycbcr2rgb
  23. elif {$cs==14} ycbcr_22rgb
  24. elif {$cs==15} yiq82rgb
  25. elif {$cs==16} yiq2rgb
  26. elif {$cs==17} yuv82rgb
  27. elif {$cs==18} yuv2rgb
  28. elif {$cs==19} bayer2rgb 0,0,0
  29. elif {$cs==20} hcy2rgb
  30. elif {$cs==21} xyz82rgb
  31. elif {$cs==22} xyz2rgb
  32. fi
  33. f "(i*$2)+$3"
  34. if {$sc==1} rgb2srgb
  35. elif {$sc==2} rgb2cmyk
  36. elif {$sc==3} rgb2cmy
  37. elif {$sc==4} rgb2hsv8
  38. elif {$sc==5} rgb2hsv
  39. elif {$sc==6} rgb2hsl8
  40. elif {$sc==7} rgb2hsl
  41. elif {$sc==8} rgb2hsi8
  42. elif {$sc==9} rgb2hsi
  43. elif {$sc==10} rgb2lch8
  44. elif {$sc==11} rgb2lch
  45. elif {$sc==12} rgb2lab8
  46. elif {$sc==13} rgb2ycbcr
  47. elif {$sc==14} rgb2ycbcr_2
  48. elif {$sc==15} rgb2yiq8
  49. elif {$sc==16} rgb2yiq
  50. elif {$sc==17} rgb2yuv8
  51. elif {$sc==18} rgb2yuv
  52. elif {$sc==19} rgb2bayer 0
  53. elif {$sc==20} rgb2hcy
  54. elif {$sc==21} rgb2xyz8
  55. elif {$cs==22} rgb2xyz
  56. fi
  57. to_rgb endl a c endl done
  58. csconvert_preview :
  59. csconvert $*
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top