The One Over None

· 1 / 0 ·

Monday, April 30, 2012

 

A Little Format Testing... moving along...


Sunday, April 29, 2012

 

Slight change in the xml data foramt.

<?xml version="1.0" encoding="utf-8"?>
<Lottery FileCount="4" FileName="My State Lottery Watch List" FileVersion="1.0">
<Game FileIndex="1" Permutations="3" Name="Minnesota Daily Pick 3" Place="MN" When="Evenings">
<Combination Position="1" BaseNumber="0" Selections="1" Items="10" />
<Combination Position="2" BaseNumber="0" Selections="1" Items="10" />
<Combination Position="3" BaseNumber="0" Selections="1" Items="10" />
<DrawData DrawCount="1000" DataError="False">000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 </DrawData>
</Game>
<Game FileIndex="2" Permutations="3" Name="Wisconsin Pick 3" Place="WI" When="Evenings">
<Combination Position="1" BaseNumber="0" Selections="1" Items="10" />
<Combination Position="2" BaseNumber="0" Selections="1" Items="10" />
<Combination Position="3" BaseNumber="0" Selections="1" Items="10" />
<DrawData DrawCount="100" DataError="False">000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 000 111 222 333 444 555 666 777 888 999 </DrawData>
</Game>
<Game FileIndex="3" Permutations="3" Name="Illinois Pick 3" Place="IL" When="Evenings">
<Combination Position="1" BaseNumber="0" Selections="1" Items="10" />
<Combination Position="2" BaseNumber="0" Selections="1" Items="10" />
<Combination Position="3" BaseNumber="0" Selections="1" Items="10" />
<DrawData DrawCount="10" DataError="False">000 111 222 333 444 555 666 777 888 999 </DrawData>
</Game>
<Game FileIndex="4" Permutations="3" Name="Iowa Pick 3" Place="IA" When="Midday">
<Combination Position="1" BaseNumber="0" Selections="1" Items="10" />
<Combination Position="2" BaseNumber="0" Selections="1" Items="10" />
<Combination Position="3" BaseNumber="0" Selections="1" Items="10" />
<DrawData DrawCount="1" DataError="False">000 </DrawData>
</Game>
</Lottery>


Saturday, April 28, 2012

 

The Holiday of Thunder this Monday 2012-04-30.

It's not all about death and destruction.

Sometimes it can be about nothing at all or just a plain ol' day of calm and peace.

Have a good day of Thunder and let it remind you the Power is within you as well.


Friday, April 20, 2012

 

Back for a limited amount of time.

We have been doing a self study of C# as it relates to our projects.

Also, we needed some time off from the LP.

We get too easily distracted with postseses and such.

Just checking mail then back to the private class Study { private void CSharp() {int i = 0; do { i = 0; } while (i < 1);} }.

In the concern of Carlin, how ya doing? Well, fuc you.

Bye.


Monday, April 2, 2012

 

Signing Off the Lottery Post...

..., for a while anyway.

Have to focus in on other projects.

Good Luck and See Ya Later.


Sunday, April 1, 2012

 

Take a look see of the HCBP use.

http://www.jadexcode.com/HCBPColor.html


Sunday, April 1, 2012

 

Reworked HCBP in VB for Better C# conversion.

The problem comes in when converting the VB - Select Case to a C# - Switch Case. We just changed to an If Else.

It would be easy to include an Alpha channel and making it an HCBPAtoARGB.

If monitors were really setup correctly the RGB would be RGBE, the complement of CMYK.

CMYK is Cyan Magenta Yellow blacK

RGBE is Red Green Blue whitE

__________

Function HCBPtoRGB(ByVal Hue As Double, ByVal Contrast As Double, ByVal Brightness As Double, ByVal Palette As Double) As Long
    'Palette = 0.0  [All Chroma Palette]  to  Palette = 1.0  [All Saturation Palette]
    'Hue, Contrast, Brightness = 0.0 to 1.0 Scale
    HCBPtoRGB = RGB(Int(255 * HCBPtoR(Hue, Contrast, Brightness, Palette)), Int(255 * HCBPtoG(Hue, Contrast, Brightness, Palette)), Int(255 * HCBPtoB(Hue, Contrast, Brightness, Palette)))
End Function

Function HCBPtoR(ByVal Hue As Double, ByVal Contrast As Double, ByVal Brightness As Double, ByVal Palette As Double)
    'Palette = 0.0  [All Chroma],  Palette = 1.0  [All Saturation]
    Dim r0, g0, b0, h0, c0, m0, x0 As Double 'Chroma Scale
    Dim r1, g1, b1, h1, c1, m1, x1 As Double 'Saturation Scale
   
    c0 = Contrast
    c1 = (1 - Abs(2 * Brightness - 1)) * Contrast
    h0 = Hue - Int(Hue)
    h1 = Hue - Int(Hue)
    x0 = c0 * (1 - Abs(Modulus((6 * h0), 2) - 1))
    x1 = c1 * (1 - Abs(Modulus((6 * h1), 2) - 1))
   
    If (((0 / 6) <= h0) And (h0 < (1 / 6))) Then
        r0 = c0: g0 = x0: b0 = 0
    ElseIf ((1 / 6) <= h0) And (h0 < (2 / 6)) Then
        r0 = x0: g0 = c0: b0 = 0
    ElseIf ((2 / 6) <= h0) And (h0 < (3 / 6)) Then
        r0 = 0: g0 = c0: b0 = x0
    ElseIf ((3 / 6) <= h0) And (h0 < (4 / 6)) Then
        r0 = 0: g0 = x0: b0 = c0
    ElseIf ((4 / 6) <= h0) And (h0 < (5 / 6)) Then
        r0 = x0: g0 = 0: b0 = c0
    ElseIf ((5 / 6) <= h0) And (h0 < (6 / 6)) Then
        r0 = c0: g0 = 0: b0 = x0
    End If
   
    If (((0 / 6) <= h1) And (h1 < (1 / 6))) Then
        r1 = c1: g1 = x1: b1 = 0
    ElseIf ((1 / 6) <= h1) And (h1 < (2 / 6)) Then
        r1 = x1: g1 = c1: b1 = 0
    ElseIf ((2 / 6) <= h1) And (h1 < (3 / 6)) Then
        r1 = 0: g1 = c1: b1 = x1
    ElseIf ((3 / 6) <= h1) And (h1 < (4 / 6)) Then
        r1 = 0: g1 = x1: b1 = c1
    ElseIf ((4 / 6) <= h1) And (h1 < (5 / 6)) Then
        r1 = x1: g1 = 0: b1 = c1
    ElseIf ((5 / 6) <= h1) And (h1 < (6 / 6)) Then
        r1 = c1: g1 = 0: b1 = x1
    End If
   
    m0 = Brightness - (0.3 * r0 + 0.59 * g0 + 0.11 * b0)
    m1 = Brightness - (c1 / 2)
   
    If ((1 - Palette) * (r0 + m0) + Palette * (r1 + m1) > 1) Then
        HCBPtoR = 1
    ElseIf ((1 - Palette) * (r0 + m0) + Palette * (r1 + m1) < 0) Then
        HCBPtoR = 0
    Else
        HCBPtoR = (1 - Palette) * (r0 + m0) + Palette * (r1 + m1)
    End If
   
End Function

Function HCBPtoG(ByVal Hue As Double, ByVal Contrast As Double, ByVal Brightness As Double, ByVal Palette As Double)
    'Palette = 0.0  [All Chroma],  Palette = 1.0  [All Saturation]
    Dim r0, g0, b0, h0, c0, m0, x0 As Double 'Chroma Scale
    Dim r1, g1, b1, h1, c1, m1, x1 As Double 'Saturation Scale
   
    c0 = Contrast
    c1 = (1 - Abs(2 * Brightness - 1)) * Contrast
    h0 = Hue - Int(Hue)
    h1 = Hue - Int(Hue)
    x0 = c0 * (1 - Abs(Modulus((6 * h0), 2) - 1))
    x1 = c1 * (1 - Abs(Modulus((6 * h1), 2) - 1))
   
    If (((0 / 6) <= h0) And (h0 < (1 / 6))) Then
        r0 = c0: g0 = x0: b0 = 0
    ElseIf ((1 / 6) <= h0) And (h0 < (2 / 6)) Then
        r0 = x0: g0 = c0: b0 = 0
    ElseIf ((2 / 6) <= h0) And (h0 < (3 / 6)) Then
        r0 = 0: g0 = c0: b0 = x0
    ElseIf ((3 / 6) <= h0) And (h0 < (4 / 6)) Then
        r0 = 0: g0 = x0: b0 = c0
    ElseIf ((4 / 6) <= h0) And (h0 < (5 / 6)) Then
        r0 = x0: g0 = 0: b0 = c0
    ElseIf ((5 / 6) <= h0) And (h0 < (6 / 6)) Then
        r0 = c0: g0 = 0: b0 = x0
    End If
   
    If (((0 / 6) <= h1) And (h1 < (1 / 6))) Then
        r1 = c1: g1 = x1: b1 = 0
    ElseIf ((1 / 6) <= h1) And (h1 < (2 / 6)) Then
        r1 = x1: g1 = c1: b1 = 0
    ElseIf ((2 / 6) <= h1) And (h1 < (3 / 6)) Then
        r1 = 0: g1 = c1: b1 = x1
    ElseIf ((3 / 6) <= h1) And (h1 < (4 / 6)) Then
        r1 = 0: g1 = x1: b1 = c1
    ElseIf ((4 / 6) <= h1) And (h1 < (5 / 6)) Then
        r1 = x1: g1 = 0: b1 = c1
    ElseIf ((5 / 6) <= h1) And (h1 < (6 / 6)) Then
        r1 = c1: g1 = 0: b1 = x1
    End If
   
    m0 = Brightness - (0.3 * r0 + 0.59 * g0 + 0.11 * b0)
    m1 = Brightness - (c1 / 2)
   
    If ((1 - Palette) * (g0 + m0) + Palette * (g1 + m1) > 1) Then
        HCBPtoG = 1
    ElseIf ((1 - Palette) * (g0 + m0) + Palette * (g1 + m1) < 0) Then
        HCBPtoG = 0
    Else
        HCBPtoG = (1 - Palette) * (g0 + m0) + Palette * (g1 + m1)
    End If

End Function

Function HCBPtoB(ByVal Hue As Double, ByVal Contrast As Double, ByVal Brightness As Double, ByVal Palette As Double)
    'Palette = 0.0  [All Chroma],  Palette = 1.0  [All Saturation]
    Dim r0, g0, b0, h0, c0, m0, x0 As Double 'Chroma Scale
    Dim r1, g1, b1, h1, c1, m1, x1 As Double 'Saturation Scale
   
    c0 = Contrast
    c1 = (1 - Abs(2 * Brightness - 1)) * Contrast
    h0 = Hue - Int(Hue)
    h1 = Hue - Int(Hue)
    x0 = c0 * (1 - Abs(Modulus((6 * h0), 2) - 1))
    x1 = c1 * (1 - Abs(Modulus((6 * h1), 2) - 1))
   
    If (((0 / 6) <= h0) And (h0 < (1 / 6))) Then
        r0 = c0: g0 = x0: b0 = 0
    ElseIf ((1 / 6) <= h0) And (h0 < (2 / 6)) Then
        r0 = x0: g0 = c0: b0 = 0
    ElseIf ((2 / 6) <= h0) And (h0 < (3 / 6)) Then
        r0 = 0: g0 = c0: b0 = x0
    ElseIf ((3 / 6) <= h0) And (h0 < (4 / 6)) Then
        r0 = 0: g0 = x0: b0 = c0
    ElseIf ((4 / 6) <= h0) And (h0 < (5 / 6)) Then
        r0 = x0: g0 = 0: b0 = c0
    ElseIf ((5 / 6) <= h0) And (h0 < (6 / 6)) Then
        r0 = c0: g0 = 0: b0 = x0
    End If
   
    If (((0 / 6) <= h1) And (h1 < (1 / 6))) Then
        r1 = c1: g1 = x1: b1 = 0
    ElseIf ((1 / 6) <= h1) And (h1 < (2 / 6)) Then
        r1 = x1: g1 = c1: b1 = 0
    ElseIf ((2 / 6) <= h1) And (h1 < (3 / 6)) Then
        r1 = 0: g1 = c1: b1 = x1
    ElseIf ((3 / 6) <= h1) And (h1 < (4 / 6)) Then
        r1 = 0: g1 = x1: b1 = c1
    ElseIf ((4 / 6) <= h1) And (h1 < (5 / 6)) Then
        r1 = x1: g1 = 0: b1 = c1
    ElseIf ((5 / 6) <= h1) And (h1 < (6 / 6)) Then
        r1 = c1: g1 = 0: b1 = x1
    End If
   
    m0 = Brightness - (0.3 * r0 + 0.59 * g0 + 0.11 * b0)
    m1 = Brightness - (c1 / 2)
   
    If ((1 - Palette) * (b0 + m0) + Palette * (b1 + m1) > 1) Then
        HCBPtoB = 1
    ElseIf ((1 - Palette) * (b0 + m0) + Palette * (b1 + m1) < 0) Then
        HCBPtoB = 0
    Else
        HCBPtoB = (1 - Palette) * (b0 + m0) + Palette * (b1 + m1)
    End If

End Function

Function Modulus(ByVal a As Double, ByVal n As Integer) As Double
    Modulus = a - (n * Int(a / n))
End Function


Sunday, April 1, 2012

 

JADE's One Hit Quantum Tables 2012-04-01

April Fool's


Sunday, April 1, 2012

 

Hue Contrast Brightness Palette

Function HCBPtoRGB(ByVal Hue As Double, ByVal Contrast As Double, ByVal Brightness As Double, ByVal Palette As Double) As Long
    'Palette = 0.0  [All Chroma Palette]  <- to ->  Palette = 1.0  [All Saturation Palette]
    'Hue, Contrast, Brightness = 0.0 to 1.0 Scale
    HCBPtoRGB = RGB(Int(255 * HCBPtoR(Hue, Contrast, Brightness, Palette)), Int(255 * HCBPtoG(Hue, Contrast, Brightness, Palette)), Int(255 * HCBPtoB(Hue, Contrast, Brightness, Palette)))
End Function

Function HCBPtoR(ByVal Hue As Double, ByVal Contrast As Double, ByVal Brightness As Double, ByVal Palette As Double)
    'Palette = 0.0  [All Chroma],  Palette = 1.0  [All Saturation]
    Dim r0, g0, b0, h0, c0, m0, x0 As Double 'Chroma Scale
    Dim r1, g1, b1, h1, c1, m1, x1 As Double 'Saturation Scale
   
    c0 = Contrast
    c1 = (1 - Abs(2 * Brightness - 1)) * Contrast
    h0 = Hue - Int(Hue)
    h1 = Hue - Int(Hue)
    x0 = c0 * (1 - Abs(Modulus((6 * h0), 2) - 1))
    x1 = c1 * (1 - Abs(Modulus((6 * h1), 2) - 1))
   
    If (((0 / 6) <= h0) And (h0 < (1 / 6))) Then
        r0 = c0: g0 = x0: b0 = 0
    ElseIf ((1 / 6) <= h0) And (h0 < (2 / 6)) Then
        r0 = x0: g0 = c0: b0 = 0
    ElseIf ((2 / 6) <= h0) And (h0 < (3 / 6)) Then
        r0 = 0: g0 = c0: b0 = x0
    ElseIf ((3 / 6) <= h0) And (h0 < (4 / 6)) Then
        r0 = 0: g0 = x0: b0 = c0
    ElseIf ((4 / 6) <= h0) And (h0 < (5 / 6)) Then
        r0 = x0: g0 = 0: b0 = c0
    ElseIf ((5 / 6) <= h0) And (h0 < (6 / 6)) Then
        r0 = c0: g0 = 0: b0 = x0
    End If
   
    If (((0 / 6) <= h1) And (h1 < (1 / 6))) Then
        r1 = c1: g1 = x1: b1 = 0
    ElseIf ((1 / 6) <= h1) And (h1 < (2 / 6)) Then
        r1 = x1: g1 = c1: b1 = 0
    ElseIf ((2 / 6) <= h1) And (h1 < (3 / 6)) Then
        r1 = 0: g1 = c1: b1 = x1
    ElseIf ((3 / 6) <= h1) And (h1 < (4 / 6)) Then
        r1 = 0: g1 = x1: b1 = c1
    ElseIf ((4 / 6) <= h1) And (h1 < (5 / 6)) Then
        r1 = x1: g1 = 0: b1 = c1
    ElseIf ((5 / 6) <= h1) And (h1 < (6 / 6)) Then
        r1 = c1: g1 = 0: b1 = x1
    End If
   
    m0 = Brightness - (0.3 * r0 + 0.59 * g0 + 0.11 * b0)
    m1 = Brightness - (c1 / 2)
   
    Select Case (1 - Palette) * (r0 + m0) + Palette * (r1 + m1)
        Case Is > 1
            HCBPtoR = 1
        Case Is < 0
            HCBPtoR = 0
        Case Else
            HCBPtoR = (1 - Palette) * (r0 + m0) + Palette * (r1 + m1)
    End Select

End Function

Function HCBPtoG(ByVal Hue As Double, ByVal Contrast As Double, ByVal Brightness As Double, ByVal Palette As Double)
    'Palette = 0.0  [All Chroma],  Palette = 1.0  [All Saturation]
    Dim r0, g0, b0, h0, c0, m0, x0 As Double 'Chroma Scale
    Dim r1, g1, b1, h1, c1, m1, x1 As Double 'Saturation Scale
   
    c0 = Contrast
    c1 = (1 - Abs(2 * Brightness - 1)) * Contrast
    h0 = Hue - Int(Hue)
    h1 = Hue - Int(Hue)
    x0 = c0 * (1 - Abs(Modulus((6 * h0), 2) - 1))
    x1 = c1 * (1 - Abs(Modulus((6 * h1), 2) - 1))
   
    If (((0 / 6) <= h0) And (h0 < (1 / 6))) Then
        r0 = c0: g0 = x0: b0 = 0
    ElseIf ((1 / 6) <= h0) And (h0 < (2 / 6)) Then
        r0 = x0: g0 = c0: b0 = 0
    ElseIf ((2 / 6) <= h0) And (h0 < (3 / 6)) Then
        r0 = 0: g0 = c0: b0 = x0
    ElseIf ((3 / 6) <= h0) And (h0 < (4 / 6)) Then
        r0 = 0: g0 = x0: b0 = c0
    ElseIf ((4 / 6) <= h0) And (h0 < (5 / 6)) Then
        r0 = x0: g0 = 0: b0 = c0
    ElseIf ((5 / 6) <= h0) And (h0 < (6 / 6)) Then
        r0 = c0: g0 = 0: b0 = x0
    End If
   
    If (((0 / 6) <= h1) And (h1 < (1 / 6))) Then
        r1 = c1: g1 = x1: b1 = 0
    ElseIf ((1 / 6) <= h1) And (h1 < (2 / 6)) Then
        r1 = x1: g1 = c1: b1 = 0
    ElseIf ((2 / 6) <= h1) And (h1 < (3 / 6)) Then
        r1 = 0: g1 = c1: b1 = x1
    ElseIf ((3 / 6) <= h1) And (h1 < (4 / 6)) Then
        r1 = 0: g1 = x1: b1 = c1
    ElseIf ((4 / 6) <= h1) And (h1 < (5 / 6)) Then
        r1 = x1: g1 = 0: b1 = c1
    ElseIf ((5 / 6) <= h1) And (h1 < (6 / 6)) Then
        r1 = c1: g1 = 0: b1 = x1
    End If
   
    m0 = Brightness - (0.3 * r0 + 0.59 * g0 + 0.11 * b0)
    m1 = Brightness - (c1 / 2)
   
    Select Case (1 - Palette) * (g0 + m0) + Palette * (g1 + m1)
        Case Is > 1
            HCBPtoG = 1
        Case Is < 0
            HCBPtoG = 0
        Case Else
            HCBPtoG = (1 - Palette) * (g0 + m0) + Palette * (g1 + m1)
    End Select

End Function

Function HCBPtoB(ByVal Hue As Double, ByVal Contrast As Double, ByVal Brightness As Double, ByVal Palette As Double)
    'Palette = 0.0  [All Chroma],  Palette = 1.0  [All Saturation]
    Dim r0, g0, b0, h0, c0, m0, x0 As Double 'Chroma Scale
    Dim r1, g1, b1, h1, c1, m1, x1 As Double 'Saturation Scale
   
    c0 = Contrast
    c1 = (1 - Abs(2 * Brightness - 1)) * Contrast
    h0 = Hue - Int(Hue)
    h1 = Hue - Int(Hue)
    x0 = c0 * (1 - Abs(Modulus((6 * h0), 2) - 1))
    x1 = c1 * (1 - Abs(Modulus((6 * h1), 2) - 1))
   
    If (((0 / 6) <= h0) And (h0 < (1 / 6))) Then
        r0 = c0: g0 = x0: b0 = 0
    ElseIf ((1 / 6) <= h0) And (h0 < (2 / 6)) Then
        r0 = x0: g0 = c0: b0 = 0
    ElseIf ((2 / 6) <= h0) And (h0 < (3 / 6)) Then
        r0 = 0: g0 = c0: b0 = x0
    ElseIf ((3 / 6) <= h0) And (h0 < (4 / 6)) Then
        r0 = 0: g0 = x0: b0 = c0
    ElseIf ((4 / 6) <= h0) And (h0 < (5 / 6)) Then
        r0 = x0: g0 = 0: b0 = c0
    ElseIf ((5 / 6) <= h0) And (h0 < (6 / 6)) Then
        r0 = c0: g0 = 0: b0 = x0
    End If
   
    If (((0 / 6) <= h1) And (h1 < (1 / 6))) Then
        r1 = c1: g1 = x1: b1 = 0
    ElseIf ((1 / 6) <= h1) And (h1 < (2 / 6)) Then
        r1 = x1: g1 = c1: b1 = 0
    ElseIf ((2 / 6) <= h1) And (h1 < (3 / 6)) Then
        r1 = 0: g1 = c1: b1 = x1
    ElseIf ((3 / 6) <= h1) And (h1 < (4 / 6)) Then
        r1 = 0: g1 = x1: b1 = c1
    ElseIf ((4 / 6) <= h1) And (h1 < (5 / 6)) Then
        r1 = x1: g1 = 0: b1 = c1
    ElseIf ((5 / 6) <= h1) And (h1 < (6 / 6)) Then
        r1 = c1: g1 = 0: b1 = x1
    End If
   
    m0 = Brightness - (0.3 * r0 + 0.59 * g0 + 0.11 * b0)
    m1 = Brightness - (c1 / 2)
   
    Select Case (1 - Palette) * (b0 + m0) + Palette * (b1 + m1)
        Case Is > 1
            HCBPtoB = 1
        Case Is < 0
            HCBPtoB = 0
        Case Else
            HCBPtoB = (1 - Palette) * (b0 + m0) + Palette * (b1 + m1)
    End Select

End Function

Function Modulus(ByVal a As Double, ByVal n As Integer) As Double
    Modulus = a - (n * Int(a / n))
End Function


Sunday, April 1, 2012

 

wouldn't you know it.

the jackpot gets won and i just got my $2,500.00 tax refund in the mail today.

well, better invested elsewhere.

Wink


Archives

March 2024   February 2024   January 2024   December 2023   November 2023   August 2023   May 2023   April 2023   March 2023   March 2021   February 2021   January 2021   December 2020   November 2020   October 2020   September 2020   August 2020   July 2020   June 2020   May 2020   April 2020   March 2020   January 2020   December 2019   November 2019   October 2019   September 2019   August 2019   July 2019   June 2019   May 2019   April 2019   March 2019   February 2019   January 2019   December 2018   November 2018   October 2018   September 2018   August 2018   July 2018   June 2018   May 2018   April 2018   March 2018   February 2018   January 2018   December 2017   November 2017   October 2017   September 2017   August 2017   July 2017   June 2017   May 2017   April 2017   March 2017   February 2017   January 2017   December 2016   November 2016   October 2016   September 2016   August 2016   July 2016   June 2016   May 2016   April 2016   March 2016   February 2016   January 2016   December 2015   November 2015   October 2015   September 2015   August 2015   July 2015   June 2015   May 2015   April 2015   March 2015   February 2015   January 2015   December 2014   November 2014   October 2014   September 2014   August 2014   July 2014   June 2014   May 2014   April 2014   March 2014   February 2014   January 2014   December 2013   November 2013   October 2013   September 2013   August 2013   July 2013   June 2013   May 2013   April 2013   March 2013   February 2013   January 2013   December 2012   November 2012   October 2012   September 2012   August 2012   July 2012   June 2012   May 2012   April 2012   March 2012   February 2012   January 2012   December 2011   November 2011   October 2011   September 2011   August 2011   July 2011   June 2011   May 2011   April 2011   March 2011   February 2011   January 2011   December 2010   November 2010   October 2010   September 2010   August 2010   July 2010   June 2010   May 2010   April 2010   March 2010   February 2010   January 2010   December 2009   November 2009   October 2009   September 2009   August 2009   July 2009   June 2009   May 2009   April 2009   March 2009   February 2009   January 2009   December 2008   November 2008   October 2008   September 2008   August 2008   July 2008   June 2008   May 2008   April 2008   March 2008   February 2008   January 2008   December 2007   November 2007   October 2007   September 2007   August 2007   July 2007   June 2007   May 2007   April 2007   March 2007   February 2007   January 2007   December 2006   November 2006   January 2006   November 2005   August 2005   July 2005   June 2005   April 2005   March 2005   February 2005   January 2005   December 2004  

Powered by Lottery PostSyndicated RSS FeedSubscribe