Skip to content

Color Schemes

Arsh edited this page Jun 17, 2020 · 2 revisions

The Color() class provides some convenience functions to work with color schemes. In the future, these would also be used to build color palettes. For now, the corresponding colors from a color scheme for a specific color can be generated like this:

from acrylic import Color, Schemes
cyan = Color(rgb=[83, 237, 229])

complementary_color = cyan.scheme(Schemes.COMPLEMENTARY)
cyan_triads = cyan.scheme(Schemes.TRIADIC)
cyan_shades = cyan.scheme(Schemes.SHADES)

Taking inspiration from traditional art where most of these color schemes originated from, these are calculated using the RYB color wheel by default. To use the RGB color wheel instead you can pass in_rgb=True to the .scheme() function:

cyan_triads = cyan.scheme(Schemes.TRIADIC, in_rgb=True)

Fuzziness

Sometimes, you dont need exact values computed for a scheme, but would like to have the colors generated be a little "fuzzy". This adds a bit of variation and uniqueness, and when working with colors sometimes deviating from the rules can create interesting combinations. To add fuzziness to the generated colors, you can pass fuzzy=<int> to .scheme() function, and it will add a random number between -fuzzy and +fuzzy to all generated hues. If you are not sure what to use as the fuzzy value, fuzzy=RANDOM should work good enough. Example:

cyan_triads = cyan.scheme(Schemes.TRIADIC, fuzzy=20)
cyan_triads = cyan.scheme(Schemes.TRIADIC, fuzzy=RANDOM)

Avaliable Color Schemes

Schemes.ANALOGOUS

Schemes.COMPLEMENTARY

Schemes.TRIADIC or Schemes.TRIANGLE

Schemes.TETRADIC or SQUARE

Schemes.MONOCHROMATIC

Schemes.SHADES

Schemes.SPLIT_COMPLEMENTARY

Schemes.ACCENTED_ANALOGOUS or Schemes.ANALOGOUS_COMPLEMENTARY

Schemes.RECTANGLE

Schemes.NEAR_COMPLEMENTARY

Schemes.COMPLEMENTARY_TRIADIC

Schemes.MODIFIED_TRIADIC

Clone this wiki locally