<template>
  <div class="coil" :style="cssProps()"></div>
</template>

<script>
import { color } from "d3-color";

export default {
  name: "Coil",
  props: ["protein", "acid", "color"],
  methods: {
    cssProps() {
      return {
        "--protein-color": this.color,
        "--hover-color": color(this.color).brighter(1.2)
      };
    }
  }
};
</script>

<style scoped>
.coil {
  flex: 1 1 0;
  background: var(--protein-color);
  height: 6px;
  display: flex;
  align-items: center;
  border-top: 7px;
  border-bottom: 7px;
  border-left: 0px;
  border-right: 0px;
  border-style: solid;
  border-color: transparent;
  background-clip: padding-box;

}
.coil:hover {
  background: var(--hover-color);
  background-clip: padding-box;

}

</style>