• TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    18 hours ago

    With computer languages, we define colors with red, blue, and green.

    It’s actually more complicated than this. We specify a color space, then define the color through parameters relevant to that color space. For example, it’s not uncommon to define a color in CSS in Oklab, which could look like 40.1% lightness at (0.1143, 0.045). It’s also common to define colors relative to other colors. Color space is also not just “well this value maps to this other value in RGB”. Different color spaces represent different spectrums of visible light, and you can represent colors in one space that you can’t in another space.

    So “when does green become black” is even more complicated to answer.

    Ambiguity is a bitch. Usually when it comes down to “is this color X or Y”, the follow-up question is “does the foreground have a contrast ratio of at least 4.5:1 against the background”. If not, then whether the color is X or Y doesn’t matter. You need a different color.

    Anyway, natural language does not map well to machine code. There’s too much ambiguity, and you lose out on the chance to answer the questions you didn’t specify answers to that come up when actually writing the code yourself. An interactive approach would take just as much effort as just writing the code itself.