cb.py

Created by schraf

Created on December 29, 2021

751 Bytes

Depuis 2019 le logo est plus simple (pas de bandes à l’intersection), voici un exemple de code :

from kandinsky import *

RO, OR, ROR, WH = (252,9,17), (254,167,0), (254,105,0), (255,255,255)
R = 80 ** 2

for l in range(222):
    for c in range(320):
        rouge = (c - 100) ** 2 + (l - 111) ** 2 < R
        orange = (c - 216) ** 2 + (l - 111) ** 2 < R
        if rouge and orange: coul = ROR
        elif rouge: coul = RO
        elif orange: coul = OR   
        if orange or rouge: set_pixel(c,l,coul)


from kandinsky import *
from random import random

RO, OR, BL, WH = (227,13,5), (242,131,18), (3,13,86), (255,255,255)
R = 80 ** 2

# on parcourt tous les pixels
for l in range(222):
    for c in range(320):
        # Ds cercle rouge ? Orange ?
        rouge = (c - 96) ** 2 + (l - 111) ** 2 < R
        orange = (c - 220) ** 2 + (l - 111) ** 2 < R
        # si ds intersection, on alterne couleurs
        if rouge and orange: coul = RO if int(l // 7) % 2 == 0 or abs(l - 111) < 15 else OR
        elif rouge: coul = RO
        elif orange: coul = OR   
        # si exterieur, bleu
        else: coul = BL
        # Bandeau blanc
        if abs(c - 160) < 125 and abs(l - 114) < 16 and random() < .35: coul = WH
        set_pixel(c,l,coul)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.