Skip to content

Commit

Permalink
Add color interpolation visual test
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Jul 19, 2021
1 parent 747d73c commit b1f331b
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions Tests/Data/VisualTests/color_interpolation.rml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<rml>
<head>
<title>Color interpolation</title>
<link type="text/rcss" href="../style.rcss"/>
<meta name="Description" content="Color interpolation using animation, border-radius property, and gradient decorator." />
<meta name="Assert" content="There should be smooth transitions between the colors. The red squares can be hovered for animation transitions." />
<link rel="GitHub discussion #207" href="https://github.com/mikke89/RmlUi/discussions/207" />
<style>
body {
background: #ddd;
color: #444;
}
div {
margin: 20dp auto;
width: 100dp;
height: 100dp;
box-sizing: border-box;
}
.animate {
background-color: #f00;
transition: background-color 0.6s linear-in-out;
}
.animate:hover {
background-color: #0f0;
}
.animate.black:hover {
background-color: #000;
}
.wide {
width: 300dp;
}
.rectangle {
decorator: gradient( horizontal #f00 #0f0 );
}
.round {
decorator: gradient( horizontal #f00 #0f0 );
border-radius: 50dp;
}
.round-border {
border-radius: 100dp;
border: 15dp #000;
border-color: #0f0 #f00 #0f0 #f00;
}
.rectangle.black {
decorator: gradient( horizontal #f00 #000 );
}
.round.black {
decorator: gradient( horizontal #f00 #000 );
border-radius: 50dp;
}
.round-border.black {
border-radius: 100dp;
border: 15dp #000;
border-color: #000 #f00 #000 #f00;
}
</style>
</head>

<body>
<div class="animate"/>
<div class="rectangle"/>
<div class="round"/>
<div class="round-border"/>
<div class="rectangle wide"/>
<div class="round wide"/>

<div class="animate black"/>
<div class="rectangle black"/>
<div class="round black"/>
<div class="round-border black"/>
<div class="rectangle black wide"/>
<div class="round black wide"/>
</body>
</rml>

0 comments on commit b1f331b

Please sign in to comment.