Search found 9 matches: hsv2rgb
Searched query: +hsv2rgb
- Wed May 29, 2024 9:55 am
- Forum: Game Programming
- Topic: Sprite brightness
- Replies: 8
- Views: 7181
- Tue Oct 03, 2017 2:21 pm
- Forum: Coding Questions
- Topic: Convert rgb to hsv
- Replies: 3
- Views: 2091
Convert rgb to hsv
... r - *in\g ) / delta ; between magenta & cyan
EndIf
*out\h * 60.0 ; degrees
If( *out\h < 0.0 )
*out\h + 360.0;
EndIf
EndProcedure
Procedure hsv2rgb(*in.hsv, *out.rgb)
Protected.d hh, p, q, t, ff;
Protected.i i ;
If *in\s <= 0.0 ; // < is bogus, just shuts up warnings
*out\r = *in\v ...
EndIf
*out\h * 60.0 ; degrees
If( *out\h < 0.0 )
*out\h + 360.0;
EndIf
EndProcedure
Procedure hsv2rgb(*in.hsv, *out.rgb)
Protected.d hh, p, q, t, ff;
Protected.i i ;
If *in\s <= 0.0 ; // < is bogus, just shuts up warnings
*out\r = *in\v ...
- Wed Jul 01, 2015 1:12 pm
- Forum: Coding Questions
- Topic: [ok] Find RGB color from Hue
- Replies: 0
- Views: 1495
[ok] Find RGB color from Hue
... n2
EndProcedure
Procedure.f MaxF(n1.f, n2.f)
If n1>n2
ProcedureReturn n1
EndIf
ProcedureReturn n2
EndProcedure
Procedure.i HSV2RGB(H.f,S.f,V.f)
Define.COLOUR sat
While h < 0
h = h + 360
Wend
While h > 360
h = h - 360
Wend
If h < 120
sat\r = (120 - h ...
EndProcedure
Procedure.f MaxF(n1.f, n2.f)
If n1>n2
ProcedureReturn n1
EndIf
ProcedureReturn n2
EndProcedure
Procedure.i HSV2RGB(H.f,S.f,V.f)
Define.COLOUR sat
While h < 0
h = h + 360
Wend
While h > 360
h = h - 360
Wend
If h < 120
sat\r = (120 - h ...
- Sat Feb 07, 2009 9:01 pm
- Forum: Coding Questions
- Topic: Emulating Photoshop's blending modes
- Replies: 15
- Views: 7326
- Tue Sep 19, 2006 3:08 pm
- Forum: Tricks 'n' Tips
- Topic: Colormodels: RGB, CMY, HLS, HSL (HLS, HSI)
- Replies: 6
- Views: 6070
Colormodels: RGB, CMY, HLS, HSL (HLS, HSI)
... if CMY is made!
*c\r = 1.0 - *c\c
*c\g = 1.0 - *c\m
*c\b = 1.0 - *c\y
*c\type = #COLOR_RGB
ProcedureReturn *c
EndProcedure
ProcedureDLL.l HSV2RGB(*c.Color) ; converts HSV-color *c to RGB and returns *c. No check if HSV is made!
Protected h.f, s.f, v.f
Protected f.f, p.f, q.f, t.f, i.l
h ...
*c\r = 1.0 - *c\c
*c\g = 1.0 - *c\m
*c\b = 1.0 - *c\y
*c\type = #COLOR_RGB
ProcedureReturn *c
EndProcedure
ProcedureDLL.l HSV2RGB(*c.Color) ; converts HSV-color *c to RGB and returns *c. No check if HSV is made!
Protected h.f, s.f, v.f
Protected f.f, p.f, q.f, t.f, i.l
h ...
- Thu Apr 28, 2005 12:54 pm
- Forum: Coding Questions
- Topic: routine for desaturate a picture/image?
- Replies: 7
- Views: 1655
- Wed Apr 27, 2005 8:42 pm
- Forum: Coding Questions
- Topic: routine for desaturate a picture/image?
- Replies: 7
- Views: 1655
- Sat Nov 08, 2003 9:20 pm
- Forum: Tricks 'n' Tips
- Topic: RGB to HSV (and back again) converter
- Replies: 1
- Views: 2175
RGB to HSV (and back again) converter
... all values between 0 and 1 for intensity of colour
; Hue is in degrees
; Lightness is between 0 And 1
; Saturation is between 0 And 1
Procedure HSV2RGB(*c1.HSV, *rgb.COLOUR)
DefType.COLOUR sat
While *c1\h < 0
*c1\h = *c1\h + 360
Wend
While *c1\h > 360
*c1\h = *c1\h - 360
Wend
If *c1\h ...
; Hue is in degrees
; Lightness is between 0 And 1
; Saturation is between 0 And 1
Procedure HSV2RGB(*c1.HSV, *rgb.COLOUR)
DefType.COLOUR sat
While *c1\h < 0
*c1\h = *c1\h + 360
Wend
While *c1\h > 360
*c1\h = *c1\h - 360
Wend
If *c1\h ...
- Sat Nov 08, 2003 6:43 pm
- Forum: Tricks 'n' Tips
- Topic: Max(), Min(), MaxF(), MinF()
- Replies: 31
- Views: 13791