Search Results

Search found 17 results on 1 pages for 'hsl'.

Page 1/1 | 1 

  • linearRGB conversion to/from HSL

    - by Otaku
    Does anyone know of a way to get HSL from an linearRGB color (not an sRGB color)? I've seen a lot of sRGB<-HSL conversions, but nothing for linearRGB<-HSL. Not sure if it is fundementally the same conversion with minor tweaks, but I'd appreciate any insight someone may have on this. Linear RGB is not the same as linearizing sRGB (which is taking [0,255] and making it [0,1]). Linear RGB transformation from/to sRGB is at http://en.wikipedia.org/wiki/SRGB. In VBA, this would be expressed (taking in linearized sRGB values [0,1]): Public Function sRGB_to_linearRGB(value As Double) If value < 0# Then sRGB_to_linearRGB = 0# Exit Function End If If value <= 0.04045 Then sRGB_to_linearRGB = value / 12.92 Exit Function End If If value <= 1# Then sRGB_to_linearRGB = ((value + 0.055) / 1.055) ^ 2.4 Exit Function End If sRGB_to_linearRGB = 1# End Function Public Function linearRGB_to_sRGB(value As Double) If value < 0# Then linearRGB_to_sRGB = 0# Exit Function End If If value <= 0.0031308 Then linearRGB_to_sRGB = value * 12.92 Exit Function End If If value < 1# Then linearRGB_to_sRGB = 1.055 * (value ^ (1# / 2.4)) - 0.055 Exit Function End If linearRGB_to_sRGB = 1# End Function I have tried sending in Linear RGB values to standard RGB_to_HSL routines and back out from HSL_to_RGB, but it does not work. I have seen almost no references that this can be done, except for two: A reference on http://en.wikipedia.org/wiki/HSL_and_HSV#cite_note-9 (numbered item 10). A reference on an open source project Grafx2 @ http://code.google.com/p/grafx2/issues/detail?id=63#c22 in which the contributor states that he has done Linear RGB <- HSL conversion and provides some C code in an attachment to his comment in a .diff file (which I can't really read :( ) My intent is to send from sRGB (for example, FF99FF (R=255, G=153, B=255)) to Linear RGB (R=1.0, G=0.318546778125092, B=1.0) using the code above (for example, the G=153 would be obtained in Linear RGB from sRGB_to_linearRGB(153 / 255)) to HSL, modify the Saturation by 350% and going back from HSL-Linear RGB-sRGB, the result would be FF19FF (R=255, G=25, B=255). Using available functions from .NET, such as .getHue from a System.Drawing.Color does not work in any sRGB space above 100% modulation of any HSL value, hence the need for Linear RGB to be sent in instead of sRGB.

    Read the article

  • Converting from RGB to HSL with Objective C

    - by treeba
    I'm quite new to objective c but have been programming for a while. I started creating a function that would convert from RGB to HSL and back again but I get a feeling it is way too long and headed in the wrong direction. Does anyone know of a simple way to perform this conversion?

    Read the article

  • Color Theory: How to convert Munsell HVC to RGB/HSB/HSL

    - by Ian Boyd
    I'm looking at at document that describes the standard colors used in dentistry to describe the color of a tooth. They quote hue, value, chroma values, and indicate they are from the 1905 Munsell description of color: The system of colour notation developed by A. H. Munsell in 1905 identifies colour in terms of three attributes: HUE, VALUE (Brightness) and CHROMA (saturation) [15] HUE (H): Munsell defined hue as the quality by which we distinguish one colour from another. He selected five principle colours: red, yellow, green, blue, and purple; and five intermediate colours: yellow-red, green-yellow, blue-green, purple-blue, and red-purple. These were placed around a colour circle at equal points and the colours in between these points are a mixture of the two, in favour of the nearer point/colour (see Fig 1.). VALUE (V): This notation indicates the lightness or darkness of a colour in relation to a neutral grey scale, which extends from absolute black (value symbol 0) to absolute white (value symbol 10). This is essentially how ‘bright’ the colour is. CHROMA (C): This indicates the degree of divergence of a given hue from a neutral grey of the same value. The scale of chroma extends from 0 for a neutral grey to 10, 12, 14 or farther, depending upon the strength (saturation) of the sample to be evaluated. There are various systems for categorising colour, the Vita system is most commonly used in Dentistry. This uses the letters A, B, C and D to notate the hue (colour) of the tooth. The chroma and value are both indicated by a value from 1 to 4. A1 being lighter than A4, but A4 being more saturated than A1. If placed in order of value, i.e. brightness, the order from brightest to darkest would be: A1, B1, B2, A2, A3, D2, C1, B3, D3, D4, A3.5, B4, C2, A4, C3, C4 The exact values of Hue, Value and Chroma for each of the shades is shown below (16) So my question is, can anyone convert Munsell HVC into RGB, HSB or HSL? Hue Value (Brightness) Chroma(Saturation) === ================== ================== 4.5 7.80 1.7 2.4 7.45 2.6 1.3 7.40 2.9 1.6 7.05 3.2 1.6 6.70 3.1 5.1 7.75 1.6 4.3 7.50 2.2 2.3 7.25 3.2 2.4 7.00 3.2 4.3 7.30 1.6 2.8 6.90 2.3 2.6 6.70 2.3 1.6 6.30 2.9 3.0 7.35 1.8 1.8 7.10 2.3 3.7 7.05 2.4 They say that Value(Brightness) varies from 0..10, which is fine. So i take 7.05 to mean 70.5%. But what is Hue measured in? i'm used to hue being measured in degrees (0..360). But the values i see would all be red - when they should be more yellow, or brown. Finally, it says that Choma/Saturation can range from 0..10 ...or even higher - which makes it sound like an arbitrary scale. So can anyone convert Munsell HVC to HSB or HSL, or better yet, RGB?

    Read the article

  • Theme confusion in SpreadsheetML.

    - by dmaruca
    I've been fighting this all day. Inside my styles.xml file I have color information given like so: <fgColor theme="0" tint="-0.249977111117893" / ECMA 376 defines a theme color reference as: Index into the <clrScheme collection, referencing a particular <sysClr or <srgbClr value expressed in the Theme part. Ok, that sounds easy. Here is an excerpt from my clrScheme xml: <a:clrScheme name="Office" <a:dk1 <a:sysClr val="windowText" lastClr="000000" / </a:dk1 <a:lt1 <a:sysClr val="window" lastClr="FFFFFF" / </a:lt1 Index zero is black, and they are wanting to darken it? I can tell you that after the tint is applied, the color should be #F2F2F2. My confusion is what does theme="0" really mean? It can't possible mean to darken #000000. Checking MSDN only confuses me even more. From http://msdn.microsoft.com/en-us/library/dd560821.aspx note that the theme color integer begins counting from left to right in the palette starting with zero. Theme color 3 is the dark 2 text/background color. Actually, if you start counting at zero the third entry is Light 2. Dark 2 is the second one. Can anyone here shed some light on this subject for me? What does theme="0" really mean? Here is the VB6 code I have been working with to apply the tint. You can paste it into your vba editor and run the test sub. Public Type tRGB R As Byte G As Byte B As Byte End Type Public Type tHSL H As Double S As Double L As Double End Type Sub TestRgbTint() Dim c As tRGB RGB_Hex2Type "ffffff", c RGB_ApplyTint c, -0.249977111117893 Debug.Print Hex(c.R) & Hex(c.G) & Hex(c.B) End Sub Public Sub RGB_Hex2Type(ByVal HexString As String, RGB As tRGB) 'Remove the alpha channel if it exists If Len(HexString) = 8 Then HexString = mID(HexString, 3) End If RGB.R = CByte("&H" & Left(HexString, 2)) RGB.G = CByte("&H" & mID(HexString, 3, 2)) RGB.B = CByte("&H" & Right(HexString, 2)) End Sub Public Sub RGB_ApplyTint(RGB As tRGB, tint As Double) Const HLSMAX = 1# Dim HSL As tHSL If tint = 0 Then Exit Sub RGB2HSL RGB, HSL If tint < 0 Then HSL.L = HSL.L * (1# + tint) Else HSL.L = HSL.L * (1# - tint) + (HLSMAX - HLSMAX * (1# - tint)) End If HSL2RGB HSL, RGB End Sub Public Sub HSL2RGB(HSL As tHSL, RGB As tRGB) HSL2RGB_ByVal HSL.H, HSL.S, HSL.L, RGB End Sub Private Sub HSL2RGB_ByVal(ByVal H As Double, ByVal S As Double, ByVal L As Double, RGB As tRGB) Dim v As Double Dim R As Double, G As Double, B As Double 'Default color to gray R = L G = L B = L If L < 0.5 Then v = L * (1# + S) Else v = L + S - L * S End If If v > 0 Then Dim m As Double, sv As Double Dim sextant As Integer Dim fract As Double, vsf As Double, mid1 As Double, mid2 As Double m = L + L - v sv = (v - m) / v H = H * 6# sextant = Int(H) fract = H - sextant vsf = v * sv * fract mid1 = m + vsf mid2 = v - vsf Select Case sextant Case 0 R = v G = mid1 B = m Case 1 R = mid2 G = v B = m Case 2 R = m G = v B = mid1 Case 3 R = m G = mid2 B = v Case 4 R = mid1 G = m B = v Case 5 R = v G = m B = mid2 End Select End If RGB.R = R * 255# RGB.G = G * 255# RGB.B = B * 255# End Sub Public Sub RGB2HSL(RGB As tRGB, HSL As tHSL) Dim R As Double, G As Double, B As Double Dim v As Double, m As Double, vm As Double Dim r2 As Double, g2 As Double, b2 As Double R = RGB.R / 255# G = RGB.G / 255# B = RGB.B / 255# 'Default to black HSL.H = 0 HSL.S = 0 HSL.L = 0 v = IIf(R > G, R, G) v = IIf(v > B, v, B) m = IIf(R < G, R, G) m = IIf(m < B, m, B) HSL.L = (m + v) / 2# If HSL.L < 0 Then Exit Sub End If vm = v - m HSL.S = vm If HSL.S > 0 Then If HSL.L <= 0.5 Then HSL.S = HSL.S / (v + m) Else HSL.S = HSL.S / (2# - v - m) End If Else Exit Sub End If r2 = (v - R) / vm g2 = (v - G) / vm b2 = (v - B) / vm If R = v Then If G = m Then HSL.H = 5# + b2 Else HSL.H = 1# - g2 End If ElseIf G = v Then If B = m Then HSL.H = 1# + r2 Else HSL.H = 3# - b2 End If Else If R = m Then HSL.H = 3# + g2 Else HSL.H = 5# - r2 End If End If HSL.H = HSL.H / 6# End Sub

    Read the article

  • Colour Name to RGB/Hex/HSL/HSV etc

    - by Abs
    Hello all, I have come across this great function/command. Colour to RGB, you can do this: col2rgb("peachpuff") //returns hex It will return one hex value. I want to extend this using Perl, Python or PHP but I want to be able to pass in, for example, "yellow" and the function returns all types of yellows - their hex/rgb/?/etc value. I already have a quick solution implemented, which involves mapping colour names to hex values but now I want to get more precise and use some formulas etc to determine what's what. However, as usual, I don't have a clue on how to do this! So I appreciate any implementation advice on how to do this. Thanks all

    Read the article

  • Photoshop: HSL Color picker plugin?

    - by Ian Boyd
    Is there a plugin that can let Photoshop use a HSL color picker, rather than HSV (which Adobe calls HSB)? In other words, any/all of the following locations could have an HSL option: Or perhaps a plugin with it's own color picker. Reference RGB HSL HSV (aka HSB) ============= =============== ================ (1, 0, 0 ) ( 0°, 1, 0.5 ) ( 0°, 1, 1 ) (0.5, 1, 0.5) (120°, 1, 0.75) (120°, 0.5, 1 ) (0, 0, 0.5) (240°, 1, 0.25) (240°, 1, 0.5)

    Read the article

  • How can I use the HSL colorspace in Java?

    - by Eric
    I've had a look at the ColorSpace class, and found the constant TYPE_HLS (which presumably is just HSL in a different order). Can I use this constant to create a Color from hue, saturation, and luminosity? If not, are there any Java classes for this, or do I need to write my own?

    Read the article

  • How do I perform an HSL transform on a texture?

    - by Mason Wheeler
    If I have an OpenGL texture, and I need to perform HSL modifications on it before rendering the texture, from what I've heard I need a shader. Problem is, I know nothing about shaders. Does anyone know where I would need to look? I want to write a function where I can pass in a texture and three values, a hue shift in degrees, and saturation and lightness multipliers between 0 and 2, and then have it call a shader that will apply these transformations to the texture before it renders. The interface would look something like this: procedure HSLTransform(texture: GLuint; hShift: integer; sMult, lMult: GLfloat); I have no idea what's supposed to go inside the routine, though. I understand the basic math involved in HSL/RGB conversions, but I don't know how to write a shader or how to apply it. Can someone point me in the right direction? Delphi examples preferred, but I can also read C if I have to.

    Read the article

  • Who could ask for more with LESS CSS? (Part 3 of 3&ndash;Clrizr)

    - by ToString(theory);
    Welcome back!  In the first two posts in this series, I covered some of the awesome features in CSS precompilers such as SASS and LESS, as well as how to get an initial project setup up and running in ASP.Net MVC 4. In this post, I will cover an actual advanced example of using LESS in a project, and show some of the great productivity features we gain from its usage. Introduction In the first post, I mentioned two subjects that I will be using in this example – constants, and color functions.  I’ve always enjoyed using online color scheme utilities such as Adobe Kuler or Color Scheme Designer to come up with a scheme based off of one primary color.  Using these tools, and requesting a complementary scheme you can get a couple of shades of your primary color, and a couple of shades of a complementary/accent color to display. Because there is no way in regular css to do color operations or store variables, there was no way to accomplish something like defining a primary color, and have a site theme cascade off of that.  However with tools such as LESS, that impossibility becomes a reality!  So, if you haven’t guessed it by now, this post is on the creation of a plugin/module/less file to drop into your project, plugin one color, and have your primary theme cascade from it.  I only went through the trouble of creating a module for getting Complementary colors.  However, it wouldn’t be too much trouble to go through other options such as Triad or Monochromatic to get a module that you could use off of that. Step 1 – Analysis I decided to mimic Adobe Kuler’s Complementary theme algorithm as I liked its simplicity and aesthetics.  Color Scheme Designer is great, but I do believe it can give you too many color options, which can lead to chaos and overload.  The first thing I had to check was if the complementary values for the color schemes were actually hues rotated by 180 degrees at all times – they aren’t.  Apparently Adobe applies some variance to the complementary colors to get colors that are actually more aesthetically appealing to users.  So, I opened up Excel and began to plot complementary hues based on rotation in increments of 10: Long story short, I completed the same calculations for Hue, Saturation, and Lightness.  For Hue, I only had to record the Complementary hue values, however for saturation and lightness, I had to record the values for ALL of the shades.  Since the functions were too complicated to put into LESS since they aren’t constant/linear, but rather interval functions, I instead opted to extrapolate the HSL values using the trendline function for each major interval, onto intervals of spacing 1. For example, using the hue extraction, I got the following values: Interval Function 0-60 60-140 140-270 270-360 Saturation and Lightness were much worse, but in the end, I finally had functions for all of the intervals, and then went the route of just grabbing each shades value in intervals of 1.  Step 2 – Mapping I declared variable names for each of these sections as something that shouldn’t ever conflict with a variable someone would define in their own file.  After I had each of the values, I extracted the values and put them into files of their own for hue variables, saturation variables, and lightness variables…  Example: /*HUE CONVERSIONS*/@clrizr-hue-source-0deg: 133.43;@clrizr-hue-source-1deg: 135.601;@clrizr-hue-source-2deg: 137.772;@clrizr-hue-source-3deg: 139.943;@clrizr-hue-source-4deg: 142.114;.../*SATURATION CONVERSIONS*/@clrizr-saturation-s2SV0px: 0;@clrizr-saturation-s2SV1px: 0;@clrizr-saturation-s2SV2px: 0;@clrizr-saturation-s2SV3px: 0;@clrizr-saturation-s2SV4px: 0;.../*LIGHTNESS CONVERSIONS*/@clrizr-lightness-s2LV0px: 30;@clrizr-lightness-s2LV1px: 31;@clrizr-lightness-s2LV2px: 32;@clrizr-lightness-s2LV3px: 33;@clrizr-lightness-s2LV4px: 34;...   In the end, I have 973 lines of mapping/conversion from source HSL to shade HSL for two extra primary shades, and two complementary shades. The last bit of the work was the file to compose each of the shades from these mappings. Step 3 – Clrizr Mapper The final step was the hardest to overcome as I was still trying to understand LESS to its fullest extent.  Imports As mentioned previously, I had separated the HSL mappings into different files, so the first necessary step is to import those for use into the Clrizr plugin: @import url("hue.less");@import url("saturation.less");@import url("lightness.less"); Extract Component Values For Each Shade Next, I extracted the necessary information for each shade HSL before shade composition: @clrizr-input-saturation: 1px+floor(saturation(@clrizr-input))-1;@clrizr-input-lightness: 1px+floor(lightness(@clrizr-input))-1; @clrizr-complementary-hue: formatstring("clrizr-hue-source-{0}", ceil(hue(@clrizr-input))); @clrizr-primary-2-saturation: formatstring("clrizr-saturation-s2SV{0}",@clrizr-input-saturation);@clrizr-primary-1-saturation: formatstring("clrizr-saturation-s1SV{0}",@clrizr-input-saturation);@clrizr-complementary-1-saturation: formatstring("clrizr-saturation-c1SV{0}",@clrizr-input-saturation); @clrizr-primary-2-lightness: formatstring("clrizr-lightness-s2LV{0}",@clrizr-input-lightness);@clrizr-primary-1-lightness: formatstring("clrizr-lightness-s1LV{0}",@clrizr-input-lightness);@clrizr-complementary-1-lightness: formatstring("clrizr-lightness-c1LV{0}",@clrizr-input-lightness); Here, you can see a couple of odd things…  On the first line, I am using operations to add units to the saturation and lightness.  This is due to some limitations in the operations that would give me saturation or lightness in %, which can’t be in a variable name.  So, I use first add 1px to it, which casts the result of the following functions as px instead of %, and then at the end, I remove that pixel.  You can also see here the formatstring method which is exactly what it sounds like – something like String.Format(string str, params object[] obj). Get Primary & Complementary Shades Now that I have components for each of the different shades, I can now compose them into each of their pieces.  For this, I use the @@ operator which will look for a variable with the name specified in a string, and then call that variable: @clrizr-primary-2: hsl(hue(@clrizr-input), @@clrizr-primary-2-saturation, @@clrizr-primary-2-lightness);@clrizr-primary-1: hsl(hue(@clrizr-input), @@clrizr-primary-1-saturation, @@clrizr-primary-1-lightness);@clrizr-primary: @clrizr-input;@clrizr-complementary-1: hsl(@@clrizr-complementary-hue, @@clrizr-complementary-1-saturation, @@clrizr-complementary-1-lightness);@clrizr-complementary-2: hsl(@@clrizr-complementary-hue, saturation(@clrizr-input), lightness(@clrizr-input)); That’s is it, for the most part.  These variables now hold the theme for the one input color – @clrizr-input.  However, I have one last addition… Perceptive Luminance Well, after I got the colors, I decided I wanted to also get the best font color that would go on top of it.  Black or white depending on light or dark color.  Now I couldn’t just go with checking the lightness, as that is half the story.  You see, the human eye doesn’t see ALL colors equally well but rather has more cells for interpreting green light compared to blue or red.  So, using the ratio, we can calculate the perceptive luminance of each of the shades, and get the font color that best matches it! @clrizr-perceptive-luminance-ps2: round(1 - ( (0.299 * red(@clrizr-primary-2) ) + ( 0.587 * green(@clrizr-primary-2) ) + (0.114 * blue(@clrizr-primary-2)))/255)*255;@clrizr-perceptive-luminance-ps1: round(1 - ( (0.299 * red(@clrizr-primary-1) ) + ( 0.587 * green(@clrizr-primary-1) ) + (0.114 * blue(@clrizr-primary-1)))/255)*255;@clrizr-perceptive-luminance-ps: round(1 - ( (0.299 * red(@clrizr-primary) ) + ( 0.587 * green(@clrizr-primary) ) + (0.114 * blue(@clrizr-primary)))/255)*255;@clrizr-perceptive-luminance-pc1: round(1 - ( (0.299 * red(@clrizr-complementary-1)) + ( 0.587 * green(@clrizr-complementary-1)) + (0.114 * blue(@clrizr-complementary-1)))/255)*255;@clrizr-perceptive-luminance-pc2: round(1 - ( (0.299 * red(@clrizr-complementary-2)) + ( 0.587 * green(@clrizr-complementary-2)) + (0.114 * blue(@clrizr-complementary-2)))/255)*255; @clrizr-col-font-on-primary-2: rgb(@clrizr-perceptive-luminance-ps2, @clrizr-perceptive-luminance-ps2, @clrizr-perceptive-luminance-ps2);@clrizr-col-font-on-primary-1: rgb(@clrizr-perceptive-luminance-ps1, @clrizr-perceptive-luminance-ps1, @clrizr-perceptive-luminance-ps1);@clrizr-col-font-on-primary: rgb(@clrizr-perceptive-luminance-ps, @clrizr-perceptive-luminance-ps, @clrizr-perceptive-luminance-ps);@clrizr-col-font-on-complementary-1: rgb(@clrizr-perceptive-luminance-pc1, @clrizr-perceptive-luminance-pc1, @clrizr-perceptive-luminance-pc1);@clrizr-col-font-on-complementary-2: rgb(@clrizr-perceptive-luminance-pc2, @clrizr-perceptive-luminance-pc2, @clrizr-perceptive-luminance-pc2); Conclusion That’s it!  I have posted a project on clrizr.codePlex.com for this, and included a testing page for you to test out how it works.  Feel free to use it in your own project, and if you have any questions, comments or suggestions, please feel free to leave them here as a comment, or on the contact page!

    Read the article

  • Sorting a list of colors in one dimension?

    - by Ptah- Opener of the Mouth
    I would like to sort a one-dimensional list of colors so that colors that a typical human would perceive as "like" each other are near each other. Obviously this is a difficult or perhaps impossible problem to get "perfectly", since colors are typically described with three dimensions, but that doesn't mean that there aren't some sorting methods that look obviously more natural than others. For example, sorting by RGB doesn't work very well, as it will sort in the following order, for example: (1) R=254 G=0 B=0 (2) R=254 G=255 B=0 (3) R=255 G=0 B=0 (4) R=255 G=255 B=0 That is, it will alternate those colors red, yellow, red, yellow, with the two "reds" being essentially imperceivably different than each other, and the two yellows also being imperceivably different from each other. But sorting by HLS works much better, generally speaking, and I think HSL even better than that; with either, the reds will be next to each other, and the yellows will be next to each other. But HLS/HSL has some problems, too; things that people would perceive as "black" could be split far apart from each other, as could things that people would perceive as "white". Again, I understand that I pretty much have to accept that there will be some splits like this; I'm just wondering if anyone has found a better way than HLS/HSL. And I'm aware that "better" is somewhat arbitrary; I mean "more natural to a typical human". For example, a vague thought I've had, but have not yet tried, is perhaps "L is the most important thing if it is very high or very low", but otherwise it is the least important. Has anyone tried this? Has it worked well? What specifically did you decide "very low" and "very high" meant? And so on. Or has anyone found anything else that would improve upon HSL? I should also note that I am aware that I can define a space-filling curve through the cube of colors, and order them one-dimensionally as they would be encountered while travelling along that curve. That would eliminate perceived discontinuities. However, it's not really what I want; I want decent overall large-scale groupings more than I want perfect small-scale groupings. Thanks in advance for any help.

    Read the article

  • Selecting Date Range on a PHP form and displaying results from MySQL database

    - by Sarah HSL
    This may be something simple but I cant understand why this wouldn't work.. I have a php form where you can select a date range from drop downs. I've given the field names day, month year, and day1, month1, year1. When clicking submit it takes you to a second php form. Here is the code for second form: <?php $username="***"; $password="***"; $database="****"; mysql_connect('localhost',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $day = $_GET['day']; $month = $_GET['month']; $year = $_GET['year']; $day1 = $_GET['day1']; $month1 = $_GET['month1']; $year1 = $_GET['year1']; $date1 = "$year-$month-$day"; $date2 = "$year1-$month1-$day1"; $query = "SELECT * FROM main_stock WHERE curr_timestamp BETWEEN '$date1' AND '$date2'"; $result=mysql_query($query); $num=mysql_num_rows($result); ?> <table border="1" cellspacing="2" cellpadding="2"> <tr> <td><b><font face="Arial, Helvetica, sans-serif">Product Description</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Category</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Master Category</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Barcode</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Status</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">TimeStamp</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">New Own</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Serial No.</font></b></td> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"product_desc"); $f2=mysql_result($result,$i,"category"); $f3=mysql_result($result,$i,"mastercategory"); $f4=mysql_result($result,$i,"barcode"); $f5=mysql_result($result,$i,"status"); $f6=mysql_result($result,$i,"curr_timestamp"); $f7=mysql_result($result,$i,"newown"); $f8=mysql_result($result,$i,"serial"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f8; ?></font></td> </tr> <?php $i++; } $num_rows = mysql_num_rows($result); echo "$num_rows Rows\n"; mysql_close(); ?> Is there any reason this wouldn't work? I'm not sure where I am going wrong. It displays results when there is another option as well as the date such as 'status' but when this is taken out and I just want to display all the results between the date range it doesn't work.. This works: <?php $username="+++"; $password="+++"; $database="+++"; mysql_connect('localhost',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $day = $_GET['day']; $month = $_GET['month']; $year = $_GET['year']; $day1 = $_GET['day1']; $month1 = $_GET['month1']; $year1 = $_GET['year1']; $status = $_GET['status']; $date1 = "$year-$month-$day"; $date2 = "$year1-$month1-$day1"; $query = "SELECT * FROM main_stock WHERE status = '$status' AND curr_timestamp BETWEEN '$date1' AND '$date2'"; $result=mysql_query($query); $num=mysql_num_rows($result); ?> <table border="1" cellspacing="2" cellpadding="2"> <tr> <td><b><font face="Arial, Helvetica, sans-serif">Product Description</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Category</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Master Category</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Barcode</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Status</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">TimeStamp</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">New Own</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Serial No.</font></b></td> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"product_desc"); $f2=mysql_result($result,$i,"category"); $f3=mysql_result($result,$i,"mastercategory"); $f4=mysql_result($result,$i,"barcode"); $f5=mysql_result($result,$i,"status"); $f6=mysql_result($result,$i,"curr_timestamp"); $f7=mysql_result($result,$i,"newown"); $f8=mysql_result($result,$i,"serial"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f8; ?></font></td> </tr> <?php $i++; } $num_rows = mysql_num_rows($result); echo "$num_rows Rows\n"; mysql_close(); ?> But when the 'status' field is taken out (and obviously the serial drop down in the first form) it stops working...

    Read the article

  • 2-components color model

    - by Cyan
    RGB is the natural color model for OpenGL. But a lot of other color models exist. For example, CMY(K) for printers, YUV for JPEG, the little cousins YCbCr and YCoCg, HSL & HSV from the 70's, and so on. All these models tend to share a common property : they are based on 3 components. Therefore my question is : Does it exist a 2-components color model ? I'm surprised to not find any. I was expecting something along the line of Hue+light could exist. I guess it cannot be as "complete" as a true 3-components color model, but a fine-enough approximation will be good for my usecase. The end objective is to store the 2 components into a single BC5 texture (GL_COMPRESSED_RED_GREEN_RGTC2 in OpenGL). The 3rd component requires a second fetch into a second texture, which hurts performance.

    Read the article

  • Poll: CSS3 color transparency

    - by lepe
    Many of you already know that you can express colors in your stylesheets like: color: #FFF; color: #FFFFFF; color: rgb(255,255,255); color: hsl(100%,100%,100%); and that you can use rgba() and hsla() to express color transparency. Do you think it would be a good idea to be able to express color transparency in #RRGGBBAA or #RGBA annotation? Why YES, and why NOT??? Also if you want, give a little of details of how you perform your development (if you use a web-builder software, a graphic software (for designs), use vim, etc..)

    Read the article

  • Fastest implementation of the frac function in C#

    - by user349937
    I would like to implement a frac function in C# (just like the one in hsl here http://msdn.microsoft.com/en-us/library/bb509603%28VS.85%29.aspx) but since it is for a very processor intensive application i would like the best version possible. I was using something like public float Frac(float value) { return value - (float)Math.Truncate(value); } but I'm having precision problems, for example for 2.6f it's returning in the unit test Expected: 0.600000024f But was: 0.599999905f I know that I can convert to decimal the value and then at the end convert to float to obtain the correct result something like this: public float Frac(float value) { return (float)((decimal)value - Decimal.Truncate((decimal)value)); } But I wonder if there is a better way without resorting to decimals...

    Read the article

  • CodePlex Daily Summary for Tuesday, October 01, 2013

    CodePlex Daily Summary for Tuesday, October 01, 2013Popular ReleasesDotNetNuke® Form and List: 06.00.06: DotNetNuke Form and List 06.00.06 Changes to 6.0.6•Add in Sql to remove 'text on row' setting for UserDefinedTable to make SQL Azure compatible. •Add new azureCompatible element to manifest. •Added a fix for importing templates. Changes to 6.0.2•Fix: MakeThumbnail was broken if the application pool was configured to .Net 4 •Change: Data is now stored in nvarchar(max) instead of ntext Changes to 6.0.1•Scripts now compatible with SQL Azure. Changes to 6.0.0•Icons are shown in module action b...BlackJumboDog: Ver5.9.6: 2013.09.30 Ver5.9.6 (1)SMTP???????、???????????????? (2)WinAPI??????? (3)Web???????CGI???????????????????????Microsoft Ajax Minifier: Microsoft Ajax Minifier 5.2: Mostly internal code tweaks. added -nosize switch to turn off the size- and gzip-calculations done after minification. removed the comments in the build targets script for the old AjaxMin build task (discussion #458831). Fixed an issue with extended Unicode characters encoded inside a string literal with adjacent \uHHHH\uHHHH sequences. Fixed an IndexOutOfRange exception when encountering a CSS identifier that's a single underscore character (_). In previous builds, the net35 and net20...AJAX Control Toolkit: September 2013 Release: AJAX Control Toolkit Release Notes - September 2013 Release Version 7.0930September 2013 release of the AJAX Control Toolkit. AJAX Control Toolkit .NET 4.5 – AJAX Control Toolkit for .NET 4.5 and sample site (Recommended). AJAX Control Toolkit .NET 4 – AJAX Control Toolkit for .NET 4 and sample site (Recommended). AJAX Control Toolkit .NET 3.5 – AJAX Control Toolkit for .NET 3.5 and sample site (Recommended). Notes: - Instructions for using the AJAX Control Toolkit with ASP.NET 4.5 can b...WDTVHubGen - Adds Metadata, thumbnails and subtitles to WDTV Live Hubs: WDTVHubGen.v2.1.4.apifix-alpha: WDTVHubGen.v2.1.4.apifix-alpha is for testers to figure out if we got the NEW api plugged in ok. thanksVisual Log Parser: VisualLogParser: Portable Visual Log Parser for Dotnet 4.0Random searcher i pochodne: Generatorek playlisty: Generuje playlisty w formacie .m3u. Na razie beta z bety - ale juz dziala i mozna uzywac.sb0t v.5: sb0t 5.15: Fixed bug in join filter. Fixed bug in pm blocking. Added new Crypto and Entities static classes to scripting. Updated the default node list.Trace Reader for Microsoft Dynamics CRM: Trace Reader (1.2013.9.29): Initial releaseAudioWordsDownloader: AudioWordsDownloader 1.1 build 88: New features list of words (mp3 files) is available upon typing when a download path is defined list of download paths is added paths history settings added Bug fixed case mismatch in word search field fixed path not exist bug fixed when history has been used path, when filled from dialog, not stored refresh autocomplete list after path change word sought is deleted when path is changed at the end sought word list is deleted word list not refreshed download ends. word lis...HD-Trailers.NET Downloader: HD-Trailer.Net Downloader v 2.1.5: This started out as an effort to improve the search for the corr3ct IMDB page for the movie. I think I have done that here. I have run about 200 movies and the correct movie was identified in all cases including some entries that were problematic in the past. I also swatted several bugs that popped up under special circumstances and resulted in exceptions. This version should be quite a bit better than previous versions. Let me know if there are any issues.Wsus Package Publisher: Release v1.3.1309.28: Fix a bug, where WPP crash when running on a computer where Windows was installed in another language than Fr, En or De, and launching the Update Creation Wizard. Fix a bug, where WPP crash if some Multi-Thread job are launch with more than 64 items. Add a button to abort "Install This Update" wizard. Allow WPP to remember which columns are shown last time. Make URL clickable on the Update Information Tab. Add a new feature, when Double-Clicking on an update, the default action exec...Tweetinvi a friendly Twitter C# API: Alpha 0.8.3.0: Version 0.8.3.0 emphasis on the FIlteredStream and ease how to manage Exceptions that can occur due to the network or any other issue you might encounter. Will be available through nuget the 29/09/2013. FilteredStream Features provided by the Twitter Stream API - Ability to track specific keywords - Ability to track specific users - Ability to track specific locations Additional features - Detect the reasons the tweet has been retrieved from the Filtered API. You have access to both the ma...AcDown?????: AcDown????? v4.5: ??●AcDown??????????、??、??、???????。????,????,?????????????????????????。???????????Acfun、????(Bilibili)、??、??、YouTube、??、???、??????、SF????、????????????。 ●??????AcPlay?????,??????、????????????????。 ● AcDown???????C#??,????.NET Framework 2.0??。?????"Acfun?????"。 ??v4.5 ???? AcPlay????????v3.5 ????????,???????????30% ?? ???????GoodManga.net???? ?? ?????????? ?? ??Acfun?????????? ??Bilibili??????????? ?????????flvcd???????? ??SfAcg????????????? ???????????? ???????????????? ????32...C# Intellisense for Notepad++: Release v1.0.6.0: Added support for classless scripts To avoid the DLLs getting locked by OS use MSI file for the installation.SimpleExcelReportMaker: Serm 0.02: SourceCode and SampleMagick.NET: Magick.NET 6.8.7.001: Magick.NET linked with ImageMagick 6.8.7.0. Breaking changes: - ToBitmap method of MagickImage returns a png instead of a bmp. - Changed the value for full transparency from 255(Q8)/65535(Q16) to 0. - MagickColor now uses floats instead of Byte/UInt16.Media Companion: Media Companion MC3.578b: With the feedback received over the renaming of Movie Folders, and files, there has been some refinement done. As well as I would like to introduce Blu-Ray movie folder support, for Pre-Frodo and Frodo onwards versions of XBMC. To start with, Context menu option for renaming movies, now has three sub options: Movie & Folder, Movie only & Folder only. The option Manual Movie Rename needs to be selected from Movie Preferences, but the autoscrape boxes do not need to be selected. Blu Ray Fo...FFXIV Crafting Simulator: Crafting Simulator 2.3: - Major refactoring of the code behind. - Added a current durability and a current CP textbox.DNN CMS Platform: 07.01.02: Major HighlightsAdded the ability to manage the Vanity URL prefix Added the ability to filter members in the member directory by role Fixed issue where the user could inadvertently click the login button multiple times Fixed issues where core classes could not be used in out of process cache provider Fixed issue where profile visibility submenu was not displayed correctly Fixed issue where the member directory was broken when Convert URL to lowercase setting was enabled Fixed issu...New Projects.netProject: .Net Project 3TINafs-m: Secure file storageASP.NET dhtmlxChart Class: Create different types of charts and render them to webforms.ASP.NET dhtmxGantt Class: Add tasks Add dependencies Use lighboxBestCodeTrainer: Project BestCode is for Training. Black Dragon Online Shop: An online shop with basic functionalities implemented with ASP.NET MVC as a team project in Telerik Academy 2012/2013.Central fovea -X: ????: 1.???????????Cell,??RGB,HSL,X,Y 2.???????? 3.???????????? 4.????????,???????? 5.????????CorvusSKK: SKK-like Japanese Input Method for Windowsdaneshjoo: ?? ??? ???????DBA Toolbox: A tool for the production DBA. A place to store all those scripts, tools, references and queries that make your job as a DBA easier.Devpad IDE: Basic integrated development environment.DXUT for Direct3D 11: Latest version of the Microsoft DXUT framework for Direct3D 11 Win32 desktop applications formerly in the now legacy DirectX SDK.Dynamics CRM Messaging Integration: This project shows how to implement a simple custom messaging solution using Microsoft Dynamics CRM and based on its standard development components.Kockafölde: Kliens program.Medusa's Ebay: Teamwork assignment @ TelerikAcademy 2012/2013. Project is for creating simple (or more complicated) interneTeamwork assignment @ TelerikAcademy 2012/2013.Nauplius.PAS: Nauplius.PAS allows end users to leverage the PowerPoint Conversion Services within SharePoint 2013 to convert PowerPoint documents from one format to another.PayBox payment gateway provider for NB_Store: PayBox payment provider for NB_StorePet passport: This is a teamwork projectProject Euler solutions: Solutions to the ProjectEuler problemsRoboSubSync: Fixes an unsynchronized subtitle in any language according to an already synced subtitle in english, with the help of some advanced algorithm magic... ShopBook: Shopbooksliders: jQuery slidersSQLite to JSON: A simple program to convert SQLite data to JSON.Super64: This is a Commodore 64 emulator that is determined to have extremely unnecessary accuracy.TeamProject1: This is just Demo ProjectXnaHelper: A collection of tools for making 2D XNA Games

    Read the article

1