Forum Liberty Basic France

Le 22/02/2018 à 00h00

Administrateur

Groupe: Administrateur

Inscrit le: 04/03/2012
Messages: 2457
Code VB :
 
      NOMAINWIN
    WindowWidth=503: WindowHeight=400
    UpperLeftX=100: UpperLeftY=20
    BUTTON #w.bl, "Noir", [blac], UL, 240, 20, 50, 20
    BUTTON #w.wh, "Blanc", [whit], UL, 310, 20, 50, 20
    BUTTON #w.ra, "R+10", [r10], UL, 10, 20, 50, 20
    BUTTON #w.ga, "G+10", [g10], UL, 70, 20, 50, 20
    BUTTON #w.ba, "B+10", [b10], UL, 130, 20, 50, 20
    BUTTON #w.rb, "R+5", [r5], UL, 10, 45, 50, 20
    BUTTON #w.gb, "G+5", [g5], UL, 70, 45, 50, 20
    BUTTON #w.bb, "B+5", [b5], UL, 130, 45, 50, 20
    BUTTON #w.rc, "R+1", [r1], UL, 10, 70, 50, 20
    BUTTON #w.gc, "G+1", [g1], UL, 70, 70, 50, 20
    BUTTON #w.bc, "B+1", [b1], UL, 130, 70, 50, 20
    BUTTON #w.rra, "R-10", [rr10], UL, 10, 140, 50, 20
    BUTTON #w.gga, "G-10", [gg10], UL, 70, 140, 50, 20
    BUTTON #w.bba, "B-10", [bb10], UL, 130, 140, 50, 20
    BUTTON #w.rrb, "R-5", [rr5], UL, 10, 165, 50, 20
    BUTTON #w.ggb, "G-5", [gg5], UL, 70, 165, 50, 20
    BUTTON #w.bbb, "B-5", [bb5], UL, 130, 165, 50, 20
    BUTTON #w.rrc, "R-1", [rr1], UL, 10, 190, 50, 20
    BUTTON #w.ggc, "G-1", [gg1], UL, 70, 190, 50, 20
    BUTTON #w.bbc, "B-1", [bb1], UL, 130, 190, 50, 20
    BUTTON #w.valcol, "Valider", [valcol], UL, 50, 230, 90, 25
 
    BUTTON #w.textnoir, "Noir", [textnoir], UL, 30, 300, 60, 25
    BUTTON #w.textblanc, "Blanc", [textblanc], UL, 110, 300, 60, 25
 
    TEXTEDITOR #w.txt, 250, 270, 150, 40
    Graphicbox #w.gr, 5, 5, 485, 335
    open "Colors R G B" FOR WINDOW AS #w
    print #w, "trapclose [quit]"
    #w.txt, "!font courrier 12 bold"
    r$="000":g$="000":b$="000"
    col$=r$+" "+g$+" "+b$
    #w.gr, "down":#w.gr, "fill ";col$: #w.gr, "flush"
    #w.gr, "font courrier 14 bold": #w.valcol, "!font courrier 12 bold"
    #w.bl, "!font courrier 12 bold": #w.wh, "!font courrier 12 bold"
    #w.textnoir, "!font courrier 12 bold": #w.textblanc, "!font courrier 12 bold"
    #w.gr, "color white": #w.gr, "backcolor ";col$
    #w.gr, "place 60, 280": #w.gr, "\ TEXTE": t$="255 255 255"
  wait
  [textnoir]
    t$="black"
    #w.textnoir, "!disable": #w.textblanc, "!enable"
    #w.gr, "color ";t$: #w.gr, "backcolor ";col$
    #w.gr, "place 60, 280": #w.gr, "\ TEXTE"
  wait
  [textblanc]
    t$="white": #w.textblanc, "!disable": #w.textnoir, "!enable"
    #w.gr, "color ";t$: #w.gr, "backcolor ";col$: #w.gr, "place 60, 280": #w.gr, "\ TEXTE"
  wait
  [valcol]
    #w.txt, "!contents? colo$"
  wait
  [ouv]
    r$=str$(r): g$=str$(g): b$=str$(b)
    col$=r$+" "+g$+" "+b$: #w.gr, "down":#w.gr, "fill ";col$
    #w.gr, "color ";t$: #w.gr, "backcolor ";col$
    #w.gr, "place 60, 280": #w.gr, "\ TEXTE"
    #w.txt, "!cls": #w.txt, chr$(34);r$;" ";g$;" ";b$;chr$(34)
    #w.gr, "flush;discard"
  wait
  [r1]
    r=r+1: gosub [verp]: goto [ouv]
  [g1]
    g=g+1: gosub [verp]: goto [ouv]
  [b1]
    b=b+1: gosub [verp]: goto [ouv]
  [r5]
    r=r+5: gosub [verp]: goto [ouv]
  [g5]
    g=g+5: gosub [verp]: goto [ouv]
  [b5]
    b=b+5: gosub [verp]: goto [ouv]
  [r10]
    r=r+10: gosub [verp]: goto [ouv]
  [g10]
    g=g+10: gosub [verp]: goto [ouv]
  [b10]
    b=b+10: gosub [verp]: goto [ouv]
    '---------------
  [rr1]
    r=r-1: gosub [verm]: goto [ouv]
  [gg1]
    g=g-1: gosub [verm]: goto [ouv]
  [bb1]
    b=b-1: gosub [verm]: goto [ouv]
  [rr5]
    r=r-5: gosub [verm]: goto [ouv]
  [gg5]
    g=g-5: gosub [verm]: goto [ouv]
  [bb5]
    b=b-5: gosub [verm]: goto [ouv]
  [rr10]
    r=r-10: gosub [verm]: goto [ouv]
  [gg10]
    g=g-10
    gosub [verm]: goto [ouv]
  [bb10]
    b=b-10: gosub [verm]: goto [ouv]
  [verp]
    if r > 255 then r=(255)
    if g > 255 then g=(255)
    if b > 255 then b=(255)
  return
  [verm]
    If r<0 then r=0
    If g<0 then g=0
    If b<0 then b=0
  return
  [blac]
    r=0:g=0:b=0: r$="0":g$="0":b$="0"
    col$=str$(r)+" "+str$(g)+" "+str$(b): #w.gr, "down":#w.gr, "fill ";col$: #w.gr, "flush"
    #w.txt, chr$(34);"0";" ";"0";" ";"0";chr$(34): t$="255 255 255"
    goto [ouv]
  wait
  [whit]
    r=255:g=255:b=255: r$="255":g$="255":b$="255"
    col$=str$(r)+" "+str$(g)+" "+str$(b): #w.gr, "down":#w.gr, "fill ";col$: #w.gr, "flush"
    #w.txt, chr$(34);r$;" ";g$;" ";b$;chr$(34): t$="0 0 0"
    goto [ouv]
  wait
  [quit]
    CLOSE #w
    END
 
 
____________________
Roro

   
Subs et Snippets » Choisir une couleur En: "R G B"  

 |  |

1 Utilisateur en ligne : 0 Administrateur, 0 Modérateur, 0 Membre et 1 Visiteur
Utilisateur en ligne : Aucun membre connecté
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie