la forma de determinar lo contrario de los valores de color hexadecimal?

  • blink182av
  • Guru
  • Guru
  • No Avatar
  • Registrado: Jun 27, 2005
  • Mensajes: 1261
  • Loc: New York
  • Status: Offline

Nota Octubre 30th, 2005, 5:25 pm

- decimal? Ja ja ja?
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Octubre 30th, 2005, 5:25 pm

  • reaper
  • Proficient
  • Proficient
  • Avatar de Usuario
  • Registrado: Abr 05, 2005
  • Mensajes: 435
  • Loc: europe
  • Status: Offline

Nota Noviembre 10th, 2005, 8:54 am

Ok chicos pensé que no lo necesita pero, despues de i muestra todavía necesita saber cómo se hace esto pero no puedo entender s & * t de esto.

¿No existe una sola pieza de software que puede escupir el valor opuesto para mí cuando entro en un determinado valor?
  • xamix
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Nov 07, 2005
  • Mensajes: 154
  • Status: Offline

Nota Noviembre 10th, 2005, 6:53 pm

http://www.artofwebdesign.co.uk/index.php?pg=rgbtohsl
http://www.artofwebdesign.co.uk/index.php?pg=hsltorgb
http://www.artofwebdesign.co.uk/colourcalculator.php


http://www.geocities.com/seedytheteck/c ... osite.html
  • reaper
  • Proficient
  • Proficient
  • Avatar de Usuario
  • Registrado: Abr 05, 2005
  • Mensajes: 435
  • Loc: europe
  • Status: Offline

Nota Noviembre 11th, 2005, 7:45 am

Gracias! Xamix que parece muy útil.
  • uberblue
  • Born
  • Born
  • No Avatar
  • Registrado: Dic 06, 2006
  • Mensajes: 1
  • Status: Offline

Nota Diciembre 6th, 2006, 8:20 pm

Yo estaba aburrido / curiosa, así que convirtió el ejemplo de PHP anteriores a la versión clásica de ASP. Esperamos que esto ayudará a alguien. El código no es el más limpio porque utiliza un traductor
( http://www.me-u.com/php-asp/ ) Y la limpieza eso. Era bastante un poco de trabajo en realidad, el traductor es bastante inútil.

Código: [ Select ]
<%

Function HexToDec(strHex)
 dim lngResult
 dim intIndex
 dim strDigit
 dim intDigit
 dim intValue

 lngResult = 0
 for intIndex = len(strHex) to 1 step -1
  strDigit = mid(strHex, intIndex, 1)
  intDigit = instr("0123456789ABCDEF", ucase(strDigit))-1
  if intDigit >= 0 then
   intValue = intDigit * (16 ^ (len(strHex)-intIndex))
   lngResult = lngResult + intValue
  else
   lngResult = 0
   intIndex = 0 ' stop the loop
  end if
 next

 HexToDec = lngResult
End Function


Dim start_colour

Function invert_colour(lv_start_colour)
    Dim lv_colour_red, lv_colour_green, lv_colour_blue, lv_new_red, lv_new_green, lv_new_blue, lv_new_colour
    lv_colour_red = HexToDec(Mid(lv_start_colour,1,2))
    lv_colour_green = HexToDec(Mid(lv_start_colour, 3, 2))
    lv_colour_blue = HexToDec(Mid(lv_start_colour, 5, 2))
    lv_new_red = Hex(255 - lv_colour_red)
    lv_new_green = Hex(255  - lv_colour_green)
    lv_new_blue = Hex(255 - lv_colour_blue)
    
    If Len(lv_new_red)=1 then
        lv_new_red = lv_new_red & "0"
    End If
    If Len(lv_new_green) = 1 then
        lv_new_green = lv_new_green & "0"
    End If
    If Len ( lv_new_blue ) = 1 then
        lv_new_blue = lv_new_blue '0'
    End If

    new_colour  = "#" & lv_new_red & lv_new_green & lv_new_blue
    invert_colour = new_colour
End Function


    start_colour  = "#ffa040"
    Response.Write "<table border=""0"" cellpadding=""1"" cellspacing=""2"" width=""200"">"
    Response.Write "<tr><td align=""center"" bgcolor=""" & start_colour & """><b><font color=""" & invert_colour(start_colour) & """>" & start_colour & "</font></b></td></tr>" & vbcrlf & vbcrlf
    Response.Write "<tr><td align=""center"" bgcolor=""" & invert_colour(start_colour) & """><b><font color=""" & start_colour & """>" & invert_colour(start_colour) & "</font></b></td></tr>" & vbcrlf & vbcrlf
    start_colour  = "#eeff99"
    Response.Write "<tr><td align=""center"" bgcolor=""" & start_colour & """><b><font color=""" & invert_colour(start_colour) & """>" & start_colour & "</font></b></td></tr>"& vbcrlf & vbcrlf
    Response.Write "<tr><td align=""center"" bgcolor=""" & invert_colour(start_colour) & """><b><font color=""" & start_colour & """>" & invert_colour(start_colour) & "</font></b></td></tr>" & vbcrlf & vbcrlf
    start_colour  = "#ff00ff"
    Response.Write "<tr><td align=""center"" bgcolor=""" & start_colour & """><b><font color=""" & invert_colour(start_colour) & """>" & start_colour & "</font></b></td></tr>" & vbcrlf & vbcrlf
    Response.Write "<tr><td align=""center"" bgcolor=""" & invert_colour(start_colour) & """><b><font color=""" & start_colour & """>" & invert_colour(start_colour) & "</font></b></td></tr>" & vbcrlf & vbcrlf
    Response.Write "</table>"
    
%>
  1. <%
  2. Function HexToDec(strHex)
  3.  dim lngResult
  4.  dim intIndex
  5.  dim strDigit
  6.  dim intDigit
  7.  dim intValue
  8.  lngResult = 0
  9.  for intIndex = len(strHex) to 1 step -1
  10.   strDigit = mid(strHex, intIndex, 1)
  11.   intDigit = instr("0123456789ABCDEF", ucase(strDigit))-1
  12.   if intDigit >= 0 then
  13.    intValue = intDigit * (16 ^ (len(strHex)-intIndex))
  14.    lngResult = lngResult + intValue
  15.   else
  16.    lngResult = 0
  17.    intIndex = 0 ' stop the loop
  18.   end if
  19.  next
  20.  HexToDec = lngResult
  21. End Function
  22. Dim start_colour
  23. Function invert_colour(lv_start_colour)
  24.     Dim lv_colour_red, lv_colour_green, lv_colour_blue, lv_new_red, lv_new_green, lv_new_blue, lv_new_colour
  25.     lv_colour_red = HexToDec(Mid(lv_start_colour,1,2))
  26.     lv_colour_green = HexToDec(Mid(lv_start_colour, 3, 2))
  27.     lv_colour_blue = HexToDec(Mid(lv_start_colour, 5, 2))
  28.     lv_new_red = Hex(255 - lv_colour_red)
  29.     lv_new_green = Hex(255  - lv_colour_green)
  30.     lv_new_blue = Hex(255 - lv_colour_blue)
  31.     
  32.     If Len(lv_new_red)=1 then
  33.         lv_new_red = lv_new_red & "0"
  34.     End If
  35.     If Len(lv_new_green) = 1 then
  36.         lv_new_green = lv_new_green & "0"
  37.     End If
  38.     If Len ( lv_new_blue ) = 1 then
  39.         lv_new_blue = lv_new_blue '0'
  40.     End If
  41.     new_colour  = "#" & lv_new_red & lv_new_green & lv_new_blue
  42.     invert_colour = new_colour
  43. End Function
  44.     start_colour  = "#ffa040"
  45.     Response.Write "<table border=""0"" cellpadding=""1"" cellspacing=""2"" width=""200"">"
  46.     Response.Write "<tr><td align=""center"" bgcolor=""" & start_colour & """><b><font color=""" & invert_colour(start_colour) & """>" & start_colour & "</font></b></td></tr>" & vbcrlf & vbcrlf
  47.     Response.Write "<tr><td align=""center"" bgcolor=""" & invert_colour(start_colour) & """><b><font color=""" & start_colour & """>" & invert_colour(start_colour) & "</font></b></td></tr>" & vbcrlf & vbcrlf
  48.     start_colour  = "#eeff99"
  49.     Response.Write "<tr><td align=""center"" bgcolor=""" & start_colour & """><b><font color=""" & invert_colour(start_colour) & """>" & start_colour & "</font></b></td></tr>"& vbcrlf & vbcrlf
  50.     Response.Write "<tr><td align=""center"" bgcolor=""" & invert_colour(start_colour) & """><b><font color=""" & start_colour & """>" & invert_colour(start_colour) & "</font></b></td></tr>" & vbcrlf & vbcrlf
  51.     start_colour  = "#ff00ff"
  52.     Response.Write "<tr><td align=""center"" bgcolor=""" & start_colour & """><b><font color=""" & invert_colour(start_colour) & """>" & start_colour & "</font></b></td></tr>" & vbcrlf & vbcrlf
  53.     Response.Write "<tr><td align=""center"" bgcolor=""" & invert_colour(start_colour) & """><b><font color=""" & start_colour & """>" & invert_colour(start_colour) & "</font></b></td></tr>" & vbcrlf & vbcrlf
  54.     Response.Write "</table>"
  55.     
  56. %>
  • CXLink
  • Expert
  • Expert
  • Avatar de Usuario
  • Registrado: Nov 22, 2004
  • Mensajes: 684
  • Loc: ATL-GA
  • Status: Offline

Nota Diciembre 7th, 2006, 5:36 am

blink182av escribió:
2,0 +2,0 = 4,0 :)


Buen trabajo parpadear estoy de acuerdo con usted. Axe me bajo del autobús antes de que el Nuevo php.
Mi definición simple de php es uno tal vez dos líneas no una o dos páginas. jajaja
Mi cabeza me duele voy a ir tomar una siesta.

Publicar Información

  • Total de mensajes en este tema: 21 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 66 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC